mirror of
https://github.com/oskvr37/tiddl.git
synced 2026-06-13 12:15:13 +03:00
🐛 Fixed album data that was not available while downloading playlists (#226)
* fetch album while handling playlist when there is "{album}" in template
* add note to the docs
This commit is contained in:
@@ -73,6 +73,14 @@ Each object type exposes fields you can use inside templates.
|
||||
| `playlist.created` | Creation date (`datetime`) | `2024-01-15 10:42:00` |
|
||||
| `playlist.updated` | Last updated date (`datetime`) | `2024-03-02 09:00:00` |
|
||||
|
||||
> [!NOTE]
|
||||
> Tidal API does not provide full album data for playlist tracks,
|
||||
> if you are downloading a playlist with template that contains `{album...}`,
|
||||
> then `tiddl` is making additional request to the API to fetch album data for a track.
|
||||
> The download may take a little longer but it's not a big deal - just one more request for every playlist track.
|
||||
> If there are multiple tracks from the same album, then the album data is cached locally,
|
||||
> and there is only one request per album. Related issue: #217
|
||||
|
||||
---
|
||||
|
||||
### Explicit
|
||||
|
||||
@@ -486,13 +486,20 @@ def download_callback(
|
||||
|
||||
for playlist_item in playlist_items.items:
|
||||
playlist_index += 1
|
||||
template = TEMPLATE or CONFIG.templates.playlist
|
||||
|
||||
if "{album" in template:
|
||||
album = ctx.obj.api.get_album(playlist_item.item.album.id)
|
||||
else:
|
||||
album = None
|
||||
|
||||
futures.append(
|
||||
handle_item(
|
||||
item=playlist_item.item,
|
||||
file_path=format_template(
|
||||
template=TEMPLATE or CONFIG.templates.playlist,
|
||||
template=template,
|
||||
item=playlist_item.item,
|
||||
album=album,
|
||||
playlist=playlist,
|
||||
playlist_index=playlist_index,
|
||||
quality=get_item_quality(playlist_item.item),
|
||||
|
||||
Reference in New Issue
Block a user