mopidy.js icon indicating copy to clipboard operation
mopidy.js copied to clipboard

Add methods for creating models

Open tkem opened this issue 10 years ago • 2 comments

As discussed in https://discuss.mopidy.com/t/unable-to-create-a-playlist-from-a-podcast-uri-in-mopidy-js/737, clients sometimes may want to create models by themselves, e.g. to add tracks to playlists. Currently, this is only possible by creating a plain JS object with the semi-documented __model__ property. Although the use case discussed above concerns the playlist API, there may be other cases where creating models, especially Refs, may be desirable. So adding functionality to create these on the client in a way that's guaranteed to work with current and future versions of the API would be a welcome addition.

tkem avatar May 21 '15 05:05 tkem

Hopefully this won't be necessary as we're designing the core API with the goal of taking URIs in and returning Refs out. The client should usually not need to pass any models back to Mopidy.

jodal avatar May 22 '15 18:05 jodal

So, how would a client add a radio station with URI and name to a playlist?

tkem avatar May 22 '15 18:05 tkem