From ff01bae12dc5ff60fa838a150716acbdea148a97 Mon Sep 17 00:00:00 2001 From: Hellow <74311245+HeIIow2@users.noreply.github.com> Date: Tue, 23 May 2023 18:11:56 +0200 Subject: [PATCH] refactored cleaning of objects --- src/music_kraken/pages/abstract.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/music_kraken/pages/abstract.py b/src/music_kraken/pages/abstract.py index fefa2ac..6c00e64 100644 --- a/src/music_kraken/pages/abstract.py +++ b/src/music_kraken/pages/abstract.py @@ -132,12 +132,11 @@ class Page(threading.Thread): return [] - @classmethod - def fetch_details(cls, music_object: Union[Song, Album, Artist, Label], stop_at_level: int = 1) -> DatabaseObject: + def fetch_details(self, music_object: Union[Song, Album, Artist, Label], stop_at_level: int = 1) -> DatabaseObject: """ when a music object with laccing data is passed in, it returns the SAME object **(no copy)** with more detailed data. - If you for example put in an album, it fetches the tracklist + If you for example put in, an album, it fetches the tracklist :param music_object: :param stop_at_level: @@ -155,7 +154,7 @@ class Page(threading.Thread): had_sources = False source: Source - for source in music_object.source_collection.get_sources_from_page(cls.SOURCE_TYPE): + for source in music_object.source_collection.get_sources_from_page(self.SOURCE_TYPE): new_music_object.merge( cls._fetch_object_from_source(source=source, obj_type=type(music_object), stop_at_level=stop_at_level)) had_sources = True