Browse/Library menus (file structure vs ID3 tags)

This commit is contained in:
rickybiscus
2017-01-09 01:02:37 +01:00
parent 3ed7b231cc
commit c6e9cc92e8
6 changed files with 95 additions and 60 deletions

View File

@ -140,6 +140,7 @@ class SubsonicClient(libsonic.Connection):
def getArtists(self, *args, **kwargs):
"""
(ID3 tags)
Improve the getArtists method. Ensures IDs are integers.
"""
@ -162,6 +163,7 @@ class SubsonicClient(libsonic.Connection):
def getArtist(self, *args, **kwargs):
"""
(ID3 tags)
Improve the getArtist method. Ensures IDs are integers.
"""
@ -209,6 +211,7 @@ class SubsonicClient(libsonic.Connection):
def getAlbum(self, *args, **kwargs):
"""
(ID3 tags)
Improve the getAlbum method. Ensures the IDs are real integers.
"""
@ -304,16 +307,9 @@ class SubsonicClient(libsonic.Connection):
response = self.getIndexes(folder_id)
for index in response["indexes"]["index"]:
for index in index["artist"]:
for item in self.walk_directory(index["id"]):
yield item
for artist in index["artist"]:
yield artist
for child in response["indexes"]["child"]:
if child.get("isDir"):
for child in self.walk_directory(child["id"]):
yield child
else:
yield child
def walk_playlists(self):
"""
@ -367,6 +363,7 @@ class SubsonicClient(libsonic.Connection):
def walk_artists(self):
"""
(ID3 tags)
Request all artists and iterate over each item.
"""
@ -409,7 +406,7 @@ class SubsonicClient(libsonic.Connection):
def walk_album(self, album_id):
"""
Request an alum and iterate over each item.
Request an album and iterate over each item.
"""
response = self.getAlbum(album_id)