diff --git a/app/api/album.py b/app/api/album.py index c71fe61c..74790c5c 100644 --- a/app/api/album.py +++ b/app/api/album.py @@ -141,6 +141,7 @@ def get_album_versions(): artisthash: str = data['artisthash'] albums = AlbumStore.get_albums_by_artisthash(artisthash) + print(base_title, artisthash) albums = [ a for a in albums @@ -148,6 +149,8 @@ def get_album_versions(): create_hash(a.base_title) == create_hash(base_title) and create_hash(og_album_title) != create_hash(a.og_title) ] + print(albums) + return { "data": albums } diff --git a/app/arg_handler.py b/app/arg_handler.py index d747f514..556baae3 100644 --- a/app/arg_handler.py +++ b/app/arg_handler.py @@ -44,7 +44,7 @@ class HandleArgs: """ Runs Pyinstaller. """ - if ALLARGS.build in ARGS: + if ALLARGS.build.value in ARGS: with open("pyinstaller.config.ini", "w", encoding="utf-8") as file: config["DEFAULT"]["BUILD"] = "True" config.write(file) @@ -73,7 +73,7 @@ class HandleArgs: @staticmethod def handle_port(): - if ALLARGS.port in ARGS: + if ALLARGS.port.value in ARGS: index = ARGS.index(ALLARGS.port.value) try: port = ARGS[index + 1] @@ -89,7 +89,7 @@ class HandleArgs: @staticmethod def handle_host(): - if ALLARGS.host in ARGS: + if ALLARGS.host.value in ARGS: index = ARGS.index(ALLARGS.host.value) try: @@ -105,7 +105,7 @@ class HandleArgs: """ Modifies the config path. """ - if ALLARGS.config in ARGS: + if ALLARGS.config.value in ARGS: index = ARGS.index(ALLARGS.config.value) try: diff --git a/app/lib/taglib.py b/app/lib/taglib.py index beef0522..d0f5cabe 100644 --- a/app/lib/taglib.py +++ b/app/lib/taglib.py @@ -64,7 +64,7 @@ def extract_thumb(filepath: str, webp_path: str) -> bool: return False -def extract_date(date_str: str | None) -> int: +def extract_date(date_str: str | None, filepath: str) -> int: try: return int(date_str.split("-")[0]) except: # pylint: disable=bare-except diff --git a/app/models/album.py b/app/models/album.py index c1b4c703..10f0cd83 100644 --- a/app/models/album.py +++ b/app/models/album.py @@ -55,6 +55,7 @@ class Album: if get_flag(ParserFlags.CLEAN_ALBUM_TITLE): # if FromFlags.CLEAN_ALBUM_TITLE: self.title, self.versions = get_base_title_and_versions(self.title) + self.base_title = self.title if "super_deluxe" in self.versions: self.versions.remove("deluxe") diff --git a/app/serializers/favorites_serializer.py b/app/serializers/favorites_serializer.py index e0a56491..bbf02f3d 100644 --- a/app/serializers/favorites_serializer.py +++ b/app/serializers/favorites_serializer.py @@ -21,7 +21,7 @@ def recent_fav_album_serializer(album: Album) -> dict: """ return { "image": album.image, - "title": album.og_title, + "title": album.title, "albumhash": album.albumhash, "colors": album.colors, } diff --git a/app/settings.py b/app/settings.py index 478eb992..8af6d7d2 100644 --- a/app/settings.py +++ b/app/settings.py @@ -145,19 +145,19 @@ class ALLARGS(Enum): class FromFlags: - EXTRACT_FEAT = False + EXTRACT_FEAT = True """ Whether to extract the featured artists from the song title. """ - REMOVE_PROD = False + REMOVE_PROD = True """ Whether to remove the producers from the song title. """ - CLEAN_ALBUM_TITLE = False - REMOVE_REMASTER_FROM_TRACK = False - SHOW_ALBUM_VERSION = False + CLEAN_ALBUM_TITLE = True + REMOVE_REMASTER_FROM_TRACK = True + SHOW_ALBUM_VERSION = True DO_PERIODIC_SCANS = True PERIODIC_SCAN_INTERVAL = 300 # seconds