mirror of
https://github.com/oskvr37/tiddl.git
synced 2026-06-13 04:05:08 +03:00
🐛 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:
@@ -137,7 +137,7 @@ allowed = [
|
||||
# album = "albums/{album.artist} - {album.title}"
|
||||
|
||||
# you can access: {playlist}
|
||||
# playlist = "playlists/{title}"
|
||||
# playlist = "playlists/{playlist.title}"
|
||||
|
||||
|
||||
[m3u]
|
||||
|
||||
@@ -679,7 +679,7 @@ def download_callback(
|
||||
and playlist.squareImage
|
||||
):
|
||||
Cover(
|
||||
playlist.squareImage, size=max(CONFIG.cover.size, 1080)
|
||||
playlist.squareImage, size=min(CONFIG.cover.size, 1080)
|
||||
).save_to_directory(
|
||||
path=DOWNLOAD_PATH
|
||||
/ format_template(
|
||||
|
||||
@@ -50,6 +50,10 @@ class Cover:
|
||||
if not self.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)
|
||||
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user