diff --git a/server/app/lib/taglib.py b/server/app/lib/taglib.py index 1292feb..4770035 100644 --- a/server/app/lib/taglib.py +++ b/server/app/lib/taglib.py @@ -33,6 +33,7 @@ def extract_thumb(filepath: str, webp_path: str) -> bool: Extracts the thumbnail from an audio file. Returns the path to the thumbnail. """ img_path = os.path.join(settings.THUMBS_PATH, webp_path) + tsize = settings.THUMB_SIZE if os.path.exists(img_path): return True @@ -43,12 +44,12 @@ def extract_thumb(filepath: str, webp_path: str) -> bool: img = Image.open(BytesIO(album_art)) try: - small_img = img.resize((250, 250), Image.ANTIALIAS) + small_img = img.resize((tsize, tsize), Image.ANTIALIAS) small_img.save(img_path, format="webp") except OSError: try: png = img.convert("RGB") - small_img = png.resize((250, 250), Image.ANTIALIAS) + small_img = png.resize((tsize, tsize), Image.ANTIALIAS) small_img.save(webp_path, format="webp") except: return False diff --git a/server/app/logger.py b/server/app/logger.py index 15b9123..ae6dffb 100644 --- a/server/app/logger.py +++ b/server/app/logger.py @@ -1,8 +1,5 @@ import logging -from app.settings import logger - - class CustomFormatter(logging.Formatter): grey = "\x1b[38;20m" diff --git a/server/app/settings.py b/server/app/settings.py index ccb2bac..bfdad24 100644 --- a/server/app/settings.py +++ b/server/app/settings.py @@ -29,5 +29,9 @@ LAST_FM_API_KEY = "762db7a44a9e6fb5585661f5f2bdf23a" CPU_COUNT = multiprocessing.cpu_count() -class logger: - enable = True +THUMB_SIZE: int = 400 +""" +The size of extracted in pixels +""" + +LOGGER_ENABLE: bool = True diff --git a/src/components/AlbumView/AlbumBio.vue b/src/components/AlbumView/AlbumBio.vue index e4f6af7..e4063e2 100644 --- a/src/components/AlbumView/AlbumBio.vue +++ b/src/components/AlbumView/AlbumBio.vue @@ -8,10 +8,10 @@ - \ No newline at end of file + diff --git a/src/components/AlbumView/Header.vue b/src/components/AlbumView/Header.vue index 2200881..5c41c3e 100644 --- a/src/components/AlbumView/Header.vue +++ b/src/components/AlbumView/Header.vue @@ -53,18 +53,17 @@ const imguri = paths.images.thumb; const nav = useNavStore(); useVisibility(albumheaderthing, nav.toggleShowPlay); - -