fixed apiUrl and added favorites

This commit is contained in:
Mario Krattenmacher
2020-12-17 15:59:58 +01:00
parent b728e9db3f
commit 558e550350
5 changed files with 45 additions and 1 deletions

View File

@@ -62,6 +62,11 @@ class RadioNetLibraryProvider(backend.LibraryProvider):
self.ref_directory(
"radionet:category:top100", "Top 100")
)
if self.backend.radionet.favorite_stations:
directories.append(
self.ref_directory(
"radionet:category:favorites", "Favorites")
)
return directories
elif variant == 'category' and identifier:
if identifier == "localstations":
@@ -70,6 +75,9 @@ class RadioNetLibraryProvider(backend.LibraryProvider):
if identifier == "top100":
for station in self.backend.radionet.top_stations:
tracks.append(self.station_to_ref(station))
if identifier == "favorites":
for station in self.backend.radionet.favorite_stations:
tracks.append(self.station_to_ref(station))
tracks.sort(key=lambda ref: ref.name)
return tracks
else: