From 713845090cee75e08af1bebb23c6a329a71565ef Mon Sep 17 00:00:00 2001 From: Bryn Edwards Date: Sat, 14 Mar 2020 18:43:53 +0000 Subject: [PATCH 01/17] Make repeated getAlbumList2 requests with offset to get all albums --- mopidy_subidy/subsonic_api.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/mopidy_subidy/subsonic_api.py b/mopidy_subidy/subsonic_api.py index e8b4ad2..78c789c 100644 --- a/mopidy_subidy/subsonic_api.py +++ b/mopidy_subidy/subsonic_api.py @@ -410,9 +410,9 @@ class SubsonicApi: return songs return [] - def get_raw_album_list(self, ltype, size=MAX_LIST_RESULTS): + def get_more_albums(self, ltype, size=MAX_LIST_RESULTS, offset=0): try: - response = self.connection.getAlbumList2(ltype=ltype, size=size) + response = self.connection.getAlbumList2(ltype=ltype, size=size, offset=offset) except Exception: logger.warning( "Connecting to subsonic failed when loading album list." @@ -429,6 +429,18 @@ class SubsonicApi: return albums return [] + def get_raw_album_list(self, ltype, size=MAX_LIST_RESULTS): + offset = 0 + total = [] + albums = self.get_more_albums(ltype, size, offset) + total = albums + while len(albums) == size: + # try getting more albums + offset = offset + size + albums = self.get_more_albums(ltype, size, offset) + total = total + albums + return total + def get_albums_as_refs(self, artist_id=None): albums = ( self.get_raw_album_list("alphabeticalByName") From ee3e36408ddd7c21b4bff45de3a605fa52114a2b Mon Sep 17 00:00:00 2001 From: Bryn Edwards Date: Sat, 14 Mar 2020 18:57:55 +0000 Subject: [PATCH 02/17] formatting --- mopidy_subidy/subsonic_api.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mopidy_subidy/subsonic_api.py b/mopidy_subidy/subsonic_api.py index 78c789c..4afec91 100644 --- a/mopidy_subidy/subsonic_api.py +++ b/mopidy_subidy/subsonic_api.py @@ -412,7 +412,9 @@ class SubsonicApi: def get_more_albums(self, ltype, size=MAX_LIST_RESULTS, offset=0): try: - response = self.connection.getAlbumList2(ltype=ltype, size=size, offset=offset) + response = self.connection.getAlbumList2( + ltype=ltype, size=size, offset=offset + ) except Exception: logger.warning( "Connecting to subsonic failed when loading album list." From 584209c1347e6a0c20577da29a8211fb91a7f434 Mon Sep 17 00:00:00 2001 From: Bryn Edwards Date: Wed, 25 Mar 2020 08:03:46 +0000 Subject: [PATCH 03/17] comment --- mopidy_subidy/subsonic_api.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mopidy_subidy/subsonic_api.py b/mopidy_subidy/subsonic_api.py index 4afec91..dfa1db1 100644 --- a/mopidy_subidy/subsonic_api.py +++ b/mopidy_subidy/subsonic_api.py @@ -432,12 +432,18 @@ class SubsonicApi: return [] def get_raw_album_list(self, ltype, size=MAX_LIST_RESULTS): + """ + Subsonic servers don't offer any way to retrieve the total number + of albums to get, and the spec states that the max number returned + for `getAlbumList2` is 500. To get all the albums, we make a + `getAlbumList2` request each time the response contains 500 albums. If + it does not, we assume we have all the albums and return them. + """ offset = 0 total = [] albums = self.get_more_albums(ltype, size, offset) total = albums while len(albums) == size: - # try getting more albums offset = offset + size albums = self.get_more_albums(ltype, size, offset) total = total + albums From eff25672d9e988d0f1bf836ff148c42a800ed254 Mon Sep 17 00:00:00 2001 From: vincent Date: Mon, 2 Nov 2020 16:08:50 +0100 Subject: [PATCH 04/17] improve research by artist --- mopidy_subidy/library.py | 3 ++- mopidy_subidy/subsonic_api.py | 29 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/mopidy_subidy/library.py b/mopidy_subidy/library.py index 6da42e0..483fbf8 100644 --- a/mopidy_subidy/library.py +++ b/mopidy_subidy/library.py @@ -147,6 +147,7 @@ class SubidyLibraryProvider(backend.LibraryProvider): return SearchResult( tracks=self.subsonic_api.get_songs_as_tracks(album.get("id")) ) + def get_distinct(self, field, query): search_result = self.search(query) @@ -173,7 +174,7 @@ class SubidyLibraryProvider(backend.LibraryProvider): query.get("artist")[0], query.get("album")[0] ) if "artist" in query: - return self.subsonic_api.find_as_search_result( + return self.subsonic_api.find_artist_as_search_result( query.get("artist")[0] ) if "any" in query: diff --git a/mopidy_subidy/subsonic_api.py b/mopidy_subidy/subsonic_api.py index e8b4ad2..dbae5df 100644 --- a/mopidy_subidy/subsonic_api.py +++ b/mopidy_subidy/subsonic_api.py @@ -93,6 +93,7 @@ class SubsonicApi: def get_censored_song_stream_uri(self, song_id): return self.get_subsonic_uri("stream", dict(id=song_id), True) + def find_raw( self, query, @@ -121,6 +122,34 @@ class SubsonicApi: return None return response.get("searchResult2") + def find_artist_as_search_result ( + self, + artist_search + ): + result = self.find_raw(artist_search) + if result is None: + return None + return SearchResult( + uri=uri.get_search_uri(artist_search), + artists=[ + self.raw_artist_to_artist(artist) + for artist in result.get("artist") or [] + if artist_search.casefold() in artist.get("name").casefold() + + ], + albums=[ + self.raw_album_to_album(album) + for album in result.get("album") or [] + if artist_search.casefold() in album.get("artist").casefold() + ], + tracks=[ + self.raw_song_to_track(song) + for song in result.get("song") or [] + if artist_search.casefold() in song.get("artist").casefold() + ], + ) + + def find_as_search_result( self, query, From 31023236ae3288a6bab8b242007e996839697974 Mon Sep 17 00:00:00 2001 From: vincent Date: Mon, 2 Nov 2020 16:25:57 +0100 Subject: [PATCH 05/17] correct formatting --- mopidy_subidy/library.py | 1 - mopidy_subidy/subsonic_api.py | 9 +++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/mopidy_subidy/library.py b/mopidy_subidy/library.py index 483fbf8..90c6bdc 100644 --- a/mopidy_subidy/library.py +++ b/mopidy_subidy/library.py @@ -147,7 +147,6 @@ class SubidyLibraryProvider(backend.LibraryProvider): return SearchResult( tracks=self.subsonic_api.get_songs_as_tracks(album.get("id")) ) - def get_distinct(self, field, query): search_result = self.search(query) diff --git a/mopidy_subidy/subsonic_api.py b/mopidy_subidy/subsonic_api.py index dbae5df..9be1e7c 100644 --- a/mopidy_subidy/subsonic_api.py +++ b/mopidy_subidy/subsonic_api.py @@ -93,7 +93,6 @@ class SubsonicApi: def get_censored_song_stream_uri(self, song_id): return self.get_subsonic_uri("stream", dict(id=song_id), True) - def find_raw( self, query, @@ -122,7 +121,7 @@ class SubsonicApi: return None return response.get("searchResult2") - def find_artist_as_search_result ( + def find_artist_as_search_result( self, artist_search ): @@ -132,10 +131,9 @@ class SubsonicApi: return SearchResult( uri=uri.get_search_uri(artist_search), artists=[ - self.raw_artist_to_artist(artist) - for artist in result.get("artist") or [] + self.raw_artist_to_artist(artist) + for artist in result.get("artist") or [] if artist_search.casefold() in artist.get("name").casefold() - ], albums=[ self.raw_album_to_album(album) @@ -149,7 +147,6 @@ class SubsonicApi: ], ) - def find_as_search_result( self, query, From f7090127feae2d0314f82166aa8bcae948337978 Mon Sep 17 00:00:00 2001 From: vincent Date: Mon, 2 Nov 2020 16:34:21 +0100 Subject: [PATCH 06/17] black reformating --- mopidy_subidy/subsonic_api.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/mopidy_subidy/subsonic_api.py b/mopidy_subidy/subsonic_api.py index 9be1e7c..c26a1b0 100644 --- a/mopidy_subidy/subsonic_api.py +++ b/mopidy_subidy/subsonic_api.py @@ -121,10 +121,7 @@ class SubsonicApi: return None return response.get("searchResult2") - def find_artist_as_search_result( - self, - artist_search - ): + def find_artist_as_search_result(self, artist_search): result = self.find_raw(artist_search) if result is None: return None From 511a101c2c4866bd13fdedf6bcaddfa21c1177af Mon Sep 17 00:00:00 2001 From: vincent Date: Mon, 2 Nov 2020 19:54:41 +0100 Subject: [PATCH 07/17] modify artist search to retur all artist track --- mopidy_subidy/library.py | 20 +++++++++++++++++--- mopidy_subidy/subsonic_api.py | 27 ++------------------------- 2 files changed, 19 insertions(+), 28 deletions(-) diff --git a/mopidy_subidy/library.py b/mopidy_subidy/library.py index 90c6bdc..bd87352 100644 --- a/mopidy_subidy/library.py +++ b/mopidy_subidy/library.py @@ -148,6 +148,22 @@ class SubidyLibraryProvider(backend.LibraryProvider): tracks=self.subsonic_api.get_songs_as_tracks(album.get("id")) ) + def search_by_artist(self, artist_search): + result = self.subsonic_api.find_raw(artist_search) + if result is None: + return None + + tracks = [] + for artist in result.get("artist"): + albums = self.subsonic_api.get_raw_albums(artist.get("id")) + for album in albums: + tracks.extend( + self.subsonic_api.get_songs_as_tracks(album.get("id")) + ) + return SearchResult( + uri=uri.get_search_uri(artist_search), tracks=tracks + ) + def get_distinct(self, field, query): search_result = self.search(query) if not search_result: @@ -173,9 +189,7 @@ class SubidyLibraryProvider(backend.LibraryProvider): query.get("artist")[0], query.get("album")[0] ) if "artist" in query: - return self.subsonic_api.find_artist_as_search_result( - query.get("artist")[0] - ) + return self.search_by_artist(query.get("artist")[0]) if "any" in query: return self.subsonic_api.find_as_search_result(query.get("any")[0]) return SearchResult(artists=self.subsonic_api.get_artists_as_artists()) diff --git a/mopidy_subidy/subsonic_api.py b/mopidy_subidy/subsonic_api.py index c26a1b0..329a482 100644 --- a/mopidy_subidy/subsonic_api.py +++ b/mopidy_subidy/subsonic_api.py @@ -101,7 +101,7 @@ class SubsonicApi: exclude_songs=False, ): try: - response = self.connection.search2( + response = self.connection.search3( query.encode("utf-8"), MAX_SEARCH_RESULTS if not exclude_artists else 0, 0, @@ -119,30 +119,7 @@ class SubsonicApi: % response.get("status") ) return None - return response.get("searchResult2") - - def find_artist_as_search_result(self, artist_search): - result = self.find_raw(artist_search) - if result is None: - return None - return SearchResult( - uri=uri.get_search_uri(artist_search), - artists=[ - self.raw_artist_to_artist(artist) - for artist in result.get("artist") or [] - if artist_search.casefold() in artist.get("name").casefold() - ], - albums=[ - self.raw_album_to_album(album) - for album in result.get("album") or [] - if artist_search.casefold() in album.get("artist").casefold() - ], - tracks=[ - self.raw_song_to_track(song) - for song in result.get("song") or [] - if artist_search.casefold() in song.get("artist").casefold() - ], - ) + return response.get("searchResult3") def find_as_search_result( self, From 6857653cdb65badf6057d06b5534c157c61b8a11 Mon Sep 17 00:00:00 2001 From: vincent Date: Mon, 2 Nov 2020 21:13:27 +0100 Subject: [PATCH 08/17] modifyng search_by_artist_and_album --- mopidy_subidy/library.py | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/mopidy_subidy/library.py b/mopidy_subidy/library.py index bd87352..d63aa66 100644 --- a/mopidy_subidy/library.py +++ b/mopidy_subidy/library.py @@ -138,31 +138,30 @@ class SubidyLibraryProvider(backend.LibraryProvider): return SearchResult(tracks=[track]) def search_by_artist_and_album(self, artist_name, album_name): - artists = self.subsonic_api.get_raw_artists() - artist = next( - item for item in artists if artist_name in item.get("name") - ) - albums = self.subsonic_api.get_raw_albums(artist.get("id")) - album = next(item for item in albums if album_name in item.get("title")) - return SearchResult( - tracks=self.subsonic_api.get_songs_as_tracks(album.get("id")) - ) + artists = self.subsonic_api.find_raw(artist_name).get("artist") + if artists is None: + return None + tracks = [] + for artist in artists: + for album in self.subsonic_api.get_raw_albums(artist.get("id")): + if album_name in album.get("name"): + tracks.extend( + self.subsonic_api.get_songs_as_tracks(album.get("id")) + ) + return SearchResult(tracks=tracks) - def search_by_artist(self, artist_search): - result = self.subsonic_api.find_raw(artist_search) + def search_by_artist(self, artist_name): + result = self.subsonic_api.find_raw(artist_name) if result is None: return None - tracks = [] for artist in result.get("artist"): - albums = self.subsonic_api.get_raw_albums(artist.get("id")) - for album in albums: - tracks.extend( - self.subsonic_api.get_songs_as_tracks(album.get("id")) + tracks.extend( + self.subsonic_api.get_artist_as_songs_as_tracks_iter( + artist.get("id") ) - return SearchResult( - uri=uri.get_search_uri(artist_search), tracks=tracks - ) + ) + return SearchResult(uri=uri.get_search_uri(artist_name), tracks=tracks) def get_distinct(self, field, query): search_result = self.search(query) From 1bc9e35d837de8422b388db07c0b65ac31b10494 Mon Sep 17 00:00:00 2001 From: vincent Date: Mon, 2 Nov 2020 23:12:39 +0100 Subject: [PATCH 09/17] add exact to search artist --- mopidy_subidy/library.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mopidy_subidy/library.py b/mopidy_subidy/library.py index d63aa66..9ae885b 100644 --- a/mopidy_subidy/library.py +++ b/mopidy_subidy/library.py @@ -150,12 +150,16 @@ class SubidyLibraryProvider(backend.LibraryProvider): ) return SearchResult(tracks=tracks) - def search_by_artist(self, artist_name): + def search_by_artist(self, artist_name,exact): result = self.subsonic_api.find_raw(artist_name) if result is None: return None tracks = [] for artist in result.get("artist"): + if exact: + if not artist.get("name") == artist_name: + continue + tracks.extend( self.subsonic_api.get_artist_as_songs_as_tracks_iter( artist.get("id") @@ -188,7 +192,8 @@ class SubidyLibraryProvider(backend.LibraryProvider): query.get("artist")[0], query.get("album")[0] ) if "artist" in query: - return self.search_by_artist(query.get("artist")[0]) + return self.search_by_artist(query.get("artist")[0], + exact) if "any" in query: return self.subsonic_api.find_as_search_result(query.get("any")[0]) return SearchResult(artists=self.subsonic_api.get_artists_as_artists()) From 81a62cdca4fec88f1e417bf497c5333ff1d92e63 Mon Sep 17 00:00:00 2001 From: vincent Date: Tue, 3 Nov 2020 20:36:28 +0100 Subject: [PATCH 10/17] add random mode in browse and search --- mopidy_subidy/library.py | 19 +++++++++++++++---- mopidy_subidy/subsonic_api.py | 30 ++++++++++++++++++++++++++++++ mopidy_subidy/uri.py | 1 + 3 files changed, 46 insertions(+), 4 deletions(-) diff --git a/mopidy_subidy/library.py b/mopidy_subidy/library.py index 9ae885b..bc5e7c2 100644 --- a/mopidy_subidy/library.py +++ b/mopidy_subidy/library.py @@ -14,6 +14,7 @@ class SubidyLibraryProvider(backend.LibraryProvider): dict(id="artists", name="Artists"), dict(id="albums", name="Albums"), dict(id="rootdirs", name="Directories"), + dict(id="random", name="Random"), ] # Create a dict with the keys being the `id`s in `vdir_templates` # and the values being objects containing the vdir `id`, @@ -52,6 +53,9 @@ class SubidyLibraryProvider(backend.LibraryProvider): def browse_rootdirs(self): return self.subsonic_api.get_rootdirs_as_refs() + def browse_random_songs(self): + return self.subsonic_api.get_random_songs_as_refs() + def browse_diritems(self, directory_id): return self.subsonic_api.get_diritems_as_refs(directory_id) @@ -82,7 +86,7 @@ class SubidyLibraryProvider(backend.LibraryProvider): def browse(self, browse_uri): if browse_uri == uri.get_vdir_uri("root"): - root_vdir_names = ["rootdirs", "artists", "albums"] + root_vdir_names = ["rootdirs", "artists", "albums", "random"] root_vdirs = [ self._vdirs[vdir_name] for vdir_name in root_vdir_names ] @@ -96,6 +100,9 @@ class SubidyLibraryProvider(backend.LibraryProvider): return self.browse_artists() elif browse_uri == uri.get_vdir_uri("albums"): return self.browse_albums() + elif browse_uri == uri.get_vdir_uri("random"): + return self.browse_random_songs() + else: uri_type = uri.get_type(browse_uri) if uri_type == uri.DIRECTORY: @@ -150,7 +157,7 @@ class SubidyLibraryProvider(backend.LibraryProvider): ) return SearchResult(tracks=tracks) - def search_by_artist(self, artist_name,exact): + def search_by_artist(self, artist_name, exact): result = self.subsonic_api.find_raw(artist_name) if result is None: return None @@ -192,8 +199,12 @@ class SubidyLibraryProvider(backend.LibraryProvider): query.get("artist")[0], query.get("album")[0] ) if "artist" in query: - return self.search_by_artist(query.get("artist")[0], - exact) + return self.search_by_artist(query.get("artist")[0], exact) + if "comment" in query: + if query.get("comment")[0] == "random": + return SearchResult( + tracks=self.subsonic_api.get_random_songs_as_tracks() + ) if "any" in query: return self.subsonic_api.find_as_search_result(query.get("any")[0]) return SearchResult(artists=self.subsonic_api.get_artists_as_artists()) diff --git a/mopidy_subidy/subsonic_api.py b/mopidy_subidy/subsonic_api.py index 329a482..789dc25 100644 --- a/mopidy_subidy/subsonic_api.py +++ b/mopidy_subidy/subsonic_api.py @@ -410,6 +410,25 @@ class SubsonicApi: return songs return [] + def get_raw_random_song(self, size=MAX_LIST_RESULTS): + try: + response = self.connection.getRandomSongs(size) + except Exception: + logger.warning( + "Connecting to subsonic failed when loading list of songs in album." + ) + return [] + if response.get("status") != RESPONSE_OK: + logger.warning( + "Got non-okay status code from subsonic: %s" + % response.get("status") + ) + return [] + songs = response.get("randomSongs").get("song") + if songs is not None: + return songs + return [] + def get_raw_album_list(self, ltype, size=MAX_LIST_RESULTS): try: response = self.connection.getAlbumList2(ltype=ltype, size=size) @@ -475,6 +494,17 @@ class SubsonicApi: for diritem in self.get_raw_dir(directory_id) ] + def get_random_songs_as_refs(self): + return [ + self.raw_song_to_ref(song) for song in self.get_raw_random_song(75) + ] + + def get_random_songs_as_tracks(self): + return [ + self.raw_song_to_track(song) + for song in self.get_raw_random_song(MAX_LIST_RESULTS) + ] + def get_artists_as_artists(self): return [ self.raw_artist_to_artist(artist) diff --git a/mopidy_subidy/uri.py b/mopidy_subidy/uri.py index 57338b8..a4d8464 100644 --- a/mopidy_subidy/uri.py +++ b/mopidy_subidy/uri.py @@ -8,6 +8,7 @@ DIRECTORY = "directory" VDIR = "vdir" PREFIX = "subidy" SEARCH = "search" +RANDOM = "random" regex = re.compile(r"(\w+?):(\w+?)(?::|$)(.+?)?$") From 7064dd9e50b15d1d2937fd962800493d30d76245 Mon Sep 17 00:00:00 2001 From: vincent Date: Tue, 3 Nov 2020 20:38:01 +0100 Subject: [PATCH 11/17] reformating --- mopidy_subidy/library.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mopidy_subidy/library.py b/mopidy_subidy/library.py index 9ae885b..8cfb319 100644 --- a/mopidy_subidy/library.py +++ b/mopidy_subidy/library.py @@ -150,7 +150,7 @@ class SubidyLibraryProvider(backend.LibraryProvider): ) return SearchResult(tracks=tracks) - def search_by_artist(self, artist_name,exact): + def search_by_artist(self, artist_name, exact): result = self.subsonic_api.find_raw(artist_name) if result is None: return None @@ -192,8 +192,7 @@ class SubidyLibraryProvider(backend.LibraryProvider): query.get("artist")[0], query.get("album")[0] ) if "artist" in query: - return self.search_by_artist(query.get("artist")[0], - exact) + return self.search_by_artist(query.get("artist")[0], exact) if "any" in query: return self.subsonic_api.find_as_search_result(query.get("any")[0]) return SearchResult(artists=self.subsonic_api.get_artists_as_artists()) From cf588481c638d7b911109b96ae138c194dd33029 Mon Sep 17 00:00:00 2001 From: Frederick Date: Thu, 19 Nov 2020 09:06:50 +0100 Subject: [PATCH 12/17] Add note about maintenance --- README.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.rst b/README.rst index bf10e40..dc5e316 100644 --- a/README.rst +++ b/README.rst @@ -14,6 +14,8 @@ Mopidy-Subidy :target: https://codecov.io/gh/Prior99/mopidy-subidy :alt: Test coverage +**This library is actively looking for maintainers to help out as I do not have the time or need to maintain this anymore. Please contact me if you feel that you could maintain this.** + A Subsonic backend for Mopidy using `py-sonic `_. From e8493923c1c15db1424d41444aa799c81a337e57 Mon Sep 17 00:00:00 2001 From: Frederick Date: Thu, 19 Nov 2020 09:14:44 +0100 Subject: [PATCH 13/17] Update version --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 2bff96f..9610cce 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = Mopidy-Subidy -version = 1.0.0 +version = 1.1.0 url = https://github.com/Prior99/mopidy-subidy author = prior99 author_email = fgnodtke@cronosx.de From b5e0de1e4deea0f043f061f9e2b2747be44c5984 Mon Sep 17 00:00:00 2001 From: vincent Date: Tue, 24 Nov 2020 14:53:17 +0100 Subject: [PATCH 14/17] correct warning --- mopidy_subidy/subsonic_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mopidy_subidy/subsonic_api.py b/mopidy_subidy/subsonic_api.py index 789dc25..793401f 100644 --- a/mopidy_subidy/subsonic_api.py +++ b/mopidy_subidy/subsonic_api.py @@ -415,7 +415,7 @@ class SubsonicApi: response = self.connection.getRandomSongs(size) except Exception: logger.warning( - "Connecting to subsonic failed when loading list of songs in album." + "Connecting to subsonic failed when loading ramdom song list." ) return [] if response.get("status") != RESPONSE_OK: From 5ce65f0a0882e78cd86d68b8ae4c5a5fb92c2f3e Mon Sep 17 00:00:00 2001 From: vincent Date: Thu, 14 Jan 2021 17:31:05 +0100 Subject: [PATCH 15/17] change argument --- mopidy_subidy/subsonic_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mopidy_subidy/subsonic_api.py b/mopidy_subidy/subsonic_api.py index 793401f..8aba02d 100644 --- a/mopidy_subidy/subsonic_api.py +++ b/mopidy_subidy/subsonic_api.py @@ -502,7 +502,7 @@ class SubsonicApi: def get_random_songs_as_tracks(self): return [ self.raw_song_to_track(song) - for song in self.get_raw_random_song(MAX_LIST_RESULTS) + for song in self.get_raw_random_song() ] def get_artists_as_artists(self): From 62429f22bd3174982a6c5b05718024fd81c3edf1 Mon Sep 17 00:00:00 2001 From: lubiana Date: Tue, 4 Feb 2025 16:41:22 +0000 Subject: [PATCH 16/17] Update mopidy_subidy/playback.py --- mopidy_subidy/playback.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mopidy_subidy/playback.py b/mopidy_subidy/playback.py index 83c0a7f..972446c 100644 --- a/mopidy_subidy/playback.py +++ b/mopidy_subidy/playback.py @@ -16,3 +16,6 @@ class SubidyPlaybackProvider(backend.PlaybackProvider): censored_url = self.subsonic_api.get_censored_song_stream_uri(song_id) logger.debug("Loading song from subsonic with url: '%s'" % censored_url) return self.subsonic_api.get_song_stream_uri(song_id) + + def should_download(self, uri): + return True From ebb2dab571eae062d94adc40b0f24c7cadc6f030 Mon Sep 17 00:00:00 2001 From: lubiana Date: Wed, 5 Feb 2025 18:55:01 +0100 Subject: [PATCH 17/17] add pkbuild --- PKGBUILD | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 PKGBUILD diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..dc95100 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,35 @@ +# Maintainer: Matthew Gamble +# Contributor: Frederick Gnodtke + +pkgname=mopidy-subidy +pkgver=1.3.0 +pkgrel=2 +pkgdesc="Mopidy extension for playing music from Subsonic servers" +arch=("any") +url="https://git.hannover.ccc.de/lubiana/mopidy-subidy/releases" +license=('BSD') +depends=( + "mopidy" + "python" + "python-setuptools" + "python-pykka" + "python-pysonic" +) +source=("https://git.hannover.ccc.de/lubiana/mopidy-subidy/archive/1.0.0.tar.gz") +sha256sums=("ed78ce86da58fb42f6ddf9a8de72169d23521125b269b51054d69375b57c5b73") + +build() { + cd "mopidy-subidy" + + python setup.py build +} + +package() { + cd "mopidy-subidy" + + PYTHONHASHSEED=0 python setup.py install --root="${pkgdir}" --optimize=1 --skip-build + + install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/mopidy-subidy/LICENSE" + install -Dm644 README.rst "${pkgdir}/usr/share/doc/mopidy-subidy/README.rst" + install -Dm644 CHANGELOG.rst "${pkgdir}/usr/share/doc/mopidy-subidy/CHANGELOG.rst" +}