Skip to content

Commit

Permalink
spotify folders not necessary as a positional arg
Browse files Browse the repository at this point in the history
- rename to folders
- remove confusing None for starred playlists
  • Loading branch information
alzeih committed Jul 28, 2013
1 parent c4dcef8 commit 47c26ac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions mopidy/backends/spotify/session_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,10 @@ def refresh_playlists(self):
if spotify_playlist.type() == 'folder_end':
folders.pop()
playlists.append(translator.to_mopidy_playlist(
spotify_playlist, folders,
spotify_playlist, folders=folders,
bitrate=self.bitrate, username=self.username))
playlists.append(translator.to_mopidy_playlist(
self.session.starred(), None,
self.session.starred(),
bitrate=self.bitrate, username=self.username))
playlists = filter(None, playlists)
self.backend.playlists.playlists = playlists
Expand Down
6 changes: 3 additions & 3 deletions mopidy/backends/spotify/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def to_mopidy_track(spotify_track, bitrate=None):
return track_cache[uri]


def to_mopidy_playlist(spotify_playlist, spotify_folders, bitrate=None, username=None):
def to_mopidy_playlist(spotify_playlist, folders=None, bitrate=None, username=None):
if spotify_playlist is None or spotify_playlist.type() != 'playlist':
return
try:
Expand All @@ -78,8 +78,8 @@ def to_mopidy_playlist(spotify_playlist, spotify_folders, bitrate=None, username
if not spotify_playlist.is_loaded():
return Playlist(uri=uri, name='[loading...]')
name = spotify_playlist.name()
if spotify_folders:
folder_names = '/'.join(folder.name() for folder in spotify_folders)
if folders:
folder_names = '/'.join(folder.name() for folder in folders)
name = folder_names + '/' + name
tracks = [
to_mopidy_track(spotify_track, bitrate=bitrate)
Expand Down

0 comments on commit 47c26ac

Please sign in to comment.