From b16db227985c46a06138b0dd6cdeedd60fb4672f Mon Sep 17 00:00:00 2001 From: geoffrey45 Date: Sun, 15 Jan 2023 22:33:20 +0300 Subject: [PATCH] update readme --- README.md | 2 +- app/lib/playlistlib.py | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 0abd02d..7447331 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ I started working on this project on dec 2021. Why? I like listening and explori - Ability to move files around without breaking my playlists and mixes. - Something that can bring together all the audio files scattered all over my disks into a single place. - Browsing related artists and albums. -- Reading artists and albums biographies. +- Reading albums & artists biographies and getting insights on song lyrics (kinda Genium.com-ish). - Web browser based user interface. - a lot more ... but I can't remember them at the moment diff --git a/app/lib/playlistlib.py b/app/lib/playlistlib.py index 6043abb..eb002a9 100644 --- a/app/lib/playlistlib.py +++ b/app/lib/playlistlib.py @@ -54,15 +54,15 @@ def create_gif_thumbnail(image: Any, img_path: str): def save_p_image(file, pid: str): """ - Saves the image of a playlist to the database. + Saves a playlist banner image and returns the filepath. """ img = Image.open(file) random_str = "".join(random.choices(string.ascii_letters + string.digits, k=5)) - img_path = pid + str(random_str) + ".webp" + filename = pid + str(random_str) + ".webp" - full_img_path = os.path.join(settings.APP_DIR, "images", "playlists", img_path) + full_img_path = os.path.join(settings.APP_DIR, "images", "playlists", filename) if file.content_type == "image/gif": frames = [] @@ -71,14 +71,14 @@ def save_p_image(file, pid: str): frames.append(frame.copy()) frames[0].save(full_img_path, save_all=True, append_images=frames[1:]) - create_gif_thumbnail(img, img_path=img_path) + create_gif_thumbnail(img, img_path=filename) - return img_path + return filename img.save(full_img_path, "webp") - create_thumbnail(img, img_path=img_path) + create_thumbnail(img, img_path=filename) - return img_path + return filename class ValidatePlaylistThumbs: