🐛 Fixed playlist cover saving (#358)

* add proper template for playlist covers

* cover size is now properly limited

* dont save cover if cover data is empty
This commit is contained in:
Oskar Dudziński
2026-05-03 20:43:36 +02:00
committed by GitHub
parent 0f9a4006f1
commit 880f6008b0
3 changed files with 6 additions and 2 deletions
+1 -1
View File
@@ -137,7 +137,7 @@ allowed = [
# album = "albums/{album.artist} - {album.title}" # album = "albums/{album.artist} - {album.title}"
# you can access: {playlist} # you can access: {playlist}
# playlist = "playlists/{title}" # playlist = "playlists/{playlist.title}"
[m3u] [m3u]
+1 -1
View File
@@ -679,7 +679,7 @@ def download_callback(
and playlist.squareImage and playlist.squareImage
): ):
Cover( Cover(
playlist.squareImage, size=max(CONFIG.cover.size, 1080) playlist.squareImage, size=min(CONFIG.cover.size, 1080)
).save_to_directory( ).save_to_directory(
path=DOWNLOAD_PATH path=DOWNLOAD_PATH
/ format_template( / format_template(
+4
View File
@@ -50,6 +50,10 @@ class Cover:
if not self.data: if not self.data:
self.data = self.fetch_data() self.data = self.fetch_data()
if not self.data:
log.debug(f"cover data is empty ({file})")
return
file.parent.mkdir(parents=True, exist_ok=True) file.parent.mkdir(parents=True, exist_ok=True)
try: try: