From 98dafb9721038043da514bef201e2b871df54c9c Mon Sep 17 00:00:00 2001 From: Robert Honz Date: Tue, 2 Apr 2024 16:09:18 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Removed=20return=20types=20from=20m?= =?UTF-8?q?ethod=20names,=20but=20added=20deprecation=20warnings=20instead?= =?UTF-8?q?.=20Fixes=20tamland/python-tidal#246?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_artist.py | 10 +++++----- tidalapi/artist.py | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/tests/test_artist.py b/tests/test_artist.py index 82b021f..62fa34a 100644 --- a/tests/test_artist.py +++ b/tests/test_artist.py @@ -61,7 +61,7 @@ def test_get_albums(session): find_ids(albums, artist.get_albums) -def test_get_albums_ep_singles(session): +def test_get_ep_singles(session): artist = session.artist(16147) albums = [ session.album(20903364), @@ -71,18 +71,18 @@ def test_get_albums_ep_singles(session): session.album(19384377), ] - find_ids(albums, artist.get_albums_ep_singles) + find_ids(albums, artist.get_ep_singles) -def test_get_albums_other(session): +def test_get_other(session): artist = session.artist(17123) albums = [ session.album(327452387), session.album(322406553), ] - other_albums = artist.get_albums_other + other_albums = artist.get_other # artist_item_ids = [item.id for item in other_albums()] - find_ids(albums, artist.get_albums_other) + find_ids(albums, artist.get_other) def test_get_top_tracks(session): diff --git a/tidalapi/artist.py b/tidalapi/artist.py index d1a4db7..da2d881 100644 --- a/tidalapi/artist.py +++ b/tidalapi/artist.py @@ -126,6 +126,13 @@ def get_albums(self, limit: Optional[int] = None, offset: int = 0) -> List["Albu return self._get_albums(params) def get_albums_ep_singles( + self, limit: Optional[int] = None, offset: int = 0 + ) -> List["Album"]: + print("This method is deprecated an will be removed in a future release. Use instead `get_ep_singles`") + + return self.get_ep_singles(limit=limit, offset=offset) + + def get_ep_singles( self, limit: Optional[int] = None, offset: int = 0 ) -> List["Album"]: """Queries TIDAL for the artists extended plays and singles. @@ -136,6 +143,13 @@ def get_albums_ep_singles( return self._get_albums(params) def get_albums_other( + self, limit: Optional[int] = None, offset: int = 0 + ) -> List["Album"]: + print("This method is deprecated an will be removed in a future release. Use instead `get_other`") + + return self.get_other(limit=limit, offset=offset) + + def get_other( self, limit: Optional[int] = None, offset: int = 0 ) -> List["Album"]: """Queries TIDAL for albums the artist has appeared on as a featured artist.