break settings.py into classes

This commit is contained in:
geoffrey45
2023-03-26 08:25:00 +03:00
parent 79029ae346
commit 357afeb700
22 changed files with 102 additions and 96 deletions
+3 -3
View File
@@ -16,7 +16,7 @@ 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.Paths.APP_DIR, "images", "playlists", thumb_path)
aspect_ratio = image.width / image.height
@@ -33,7 +33,7 @@ def create_gif_thumbnail(image: Any, img_path: 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.Paths.APP_DIR, "images", "playlists", thumb_path)
frames = []
@@ -60,7 +60,7 @@ def save_p_image(file, pid: str):
filename = pid + str(random_str) + ".webp"
full_img_path = os.path.join(settings.PLAYLIST_IMG_PATH, filename)
full_img_path = os.path.join(settings.Paths.PLAYLIST_IMG_PATH, filename)
if file.content_type == "image/gif":
frames = []