Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetPlaylists only with names and uri's #297

Closed
woutervanwijk opened this issue Dec 29, 2012 · 6 comments · Fixed by #313
Closed

GetPlaylists only with names and uri's #297

woutervanwijk opened this issue Dec 29, 2012 · 6 comments · Fixed by #313
Assignees
Labels
A-core Area: Core layer A-http Area: HTTP frontend
Milestone

Comments

@woutervanwijk
Copy link
Contributor

For the http-frontend, getting the whole list of playlists including all tracks is a bit too much. It works, but it slows the interface down too much, especially in webkit. Firefox handles it ok, but webkit doesn't, it locks up for a while. It would be great to have an option to get only the playlist-names and uri's, so that you could load the tracks after the user clicks on a playlist via a lookup.

@adamcik
Copy link
Member

adamcik commented Jan 5, 2013

Hmm, I'm wondering if there should a PlaylistReference model or something like that which is really just a sub-set of a playlist for providing say name, uri and track count. Alternative would be just to re-use the model we have and not set tracks, but I would kinda like to have a clear separation between a partial and full playlist.

@jodal
Copy link
Member

jodal commented Jan 5, 2013

I can understand that you want to keep a separation here, but I'm afraid adding e.g. a PlaylistRef which is simply a Playlist without tracks would just be more confusing to "end developers"?

What about extending core.playlists.get_playlist() to take a keyword argument include_tracks=True. Then the "end developer" will always have to explicitly ask us to strip out the tracks before returning the playlists.

@adamcik
Copy link
Member

adamcik commented Jan 5, 2013

Mhm, that was the other alternative I was thinking of, but in that case I guess we would want a num_tracks field to playlists.

@jodal
Copy link
Member

jodal commented Jan 5, 2013

Yeah, that would be nice. Should the playlist creator set it manually, or should the Playlist model have some logic for setting it? We must be able to make a copy of the playlist with 0 tracks without resetting the num_tracks field to 0.

@woutervanwijk
Copy link
Contributor Author

It's both ok for me. I would even be fine if there was a simple function like this:
I tried to add it to the base-backend, but it doesn't show up in javascript :-(
It's much faster when I tested i btw


def get_playlists_light(self):
    """
    Get currently available playlists, but without tracks.

    """
    lightplaylists = []
    for pl in self._playlists:
        lightplaylists.append({'uri':pl.uri, 'name':pl.name})
    return lightplaylists

@jodal
Copy link
Member

jodal commented Jan 6, 2013

Fixed by #313.

@jodal jodal closed this as completed Jan 6, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: Core layer A-http Area: HTTP frontend
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants