mirror of
https://github.com/tcsenpai/swingmusic.git
synced 2025-06-06 03:05:35 +00:00
update readme
This commit is contained in:
parent
ccb0192693
commit
b16db22798
@ -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
|
||||
|
||||
|
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user