mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-05 04:53:01 +00:00
Restyle Integrate topbar and refactor playlists page (#31)
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import time
|
||||
from typing import List
|
||||
from app import api, helpers, models
|
||||
|
||||
from app import api
|
||||
from app import helpers
|
||||
from app import models
|
||||
from progress.bar import Bar
|
||||
|
||||
|
||||
|
||||
@@ -35,7 +35,8 @@ def add_track(playlistid: str, trackid: str):
|
||||
|
||||
try:
|
||||
playlist.add_track(track)
|
||||
instances.playlist_instance.add_track_to_playlist(playlistid, track)
|
||||
instances.playlist_instance.add_track_to_playlist(
|
||||
playlistid, track)
|
||||
return
|
||||
except TrackExistsInPlaylist as error:
|
||||
raise error
|
||||
@@ -68,7 +69,8 @@ def create_thumbnail(image: any, img_path: str) -> str:
|
||||
Creates a 250 x 250 thumbnail from a playlist image
|
||||
"""
|
||||
thumb_path = "thumb_" + img_path
|
||||
full_thumb_path = os.path.join(settings.APP_DIR, "images", "playlists", thumb_path)
|
||||
full_thumb_path = os.path.join(settings.APP_DIR, "images", "playlists",
|
||||
thumb_path)
|
||||
|
||||
aspect_ratio = image.width / image.height
|
||||
|
||||
@@ -86,11 +88,13 @@ def save_p_image(file: datastructures.FileStorage, pid: str):
|
||||
"""
|
||||
img = Image.open(file)
|
||||
|
||||
random_str = "".join(random.choices(string.ascii_letters + string.digits, k=5))
|
||||
random_str = "".join(
|
||||
random.choices(string.ascii_letters + string.digits, k=5))
|
||||
|
||||
img_path = 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",
|
||||
img_path)
|
||||
|
||||
if file.content_type == "image/gif":
|
||||
frames = []
|
||||
|
||||
Reference in New Issue
Block a user