From 2ff58d3a30a253114f5ff0b94c46a40381e235c3 Mon Sep 17 00:00:00 2001 From: Hellow2 Date: Mon, 27 Mar 2023 16:20:16 +0200 Subject: [PATCH] fixed faulty type hint and old function --- src/music_kraken/pages/abstract.py | 4 ++-- src/music_kraken/pages/musify.py | 4 ++-- src/musify_search.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/music_kraken/pages/abstract.py b/src/music_kraken/pages/abstract.py index dc916e3..9ca0afa 100644 --- a/src/music_kraken/pages/abstract.py +++ b/src/music_kraken/pages/abstract.py @@ -34,7 +34,7 @@ class Page: @classmethod def get_request(cls, url: str, accepted_response_codes: set = set((200,)), trie: int = 0) -> Optional[ - requests.Request]: + requests.Response]: try: r = cls.API_SESSION.get(url, timeout=cls.TIMEOUT) except requests.exceptions.Timeout: @@ -53,7 +53,7 @@ class Page: @classmethod def post_request(cls, url: str, json: dict, accepted_response_codes: set = set((200,)), trie: int = 0) -> Optional[ - requests.Request]: + requests.Response]: try: r = cls.API_SESSION.post(url, json=json, timeout=cls.TIMEOUT) except requests.exceptions.Timeout: diff --git a/src/music_kraken/pages/musify.py b/src/music_kraken/pages/musify.py index a78ed93..f73926d 100644 --- a/src/music_kraken/pages/musify.py +++ b/src/music_kraken/pages/musify.py @@ -257,13 +257,13 @@ class Musify(Page): else: LOGGER.warning("got an unequal ammount than 3 small elements") - return cls.ALBUM_CACHE.append(Album( + return Album( _id=_id, title=title, source_list=source_list, date=ID3Timestamp(year=year), artist_list=artist_list - )) + ) @classmethod def parse_contact_container(cls, contact_container_soup: BeautifulSoup) -> List[Union[Artist, Album]]: diff --git a/src/musify_search.py b/src/musify_search.py index 63a23bd..a90c209 100644 --- a/src/musify_search.py +++ b/src/musify_search.py @@ -33,4 +33,4 @@ def fetch_album(): print(artist.id, artist.name) if __name__ == "__main__": - fetch_album() + search()