Commit Graph

24 Commits

Author SHA1 Message Date
Oskar Dudziński c285be6ed2 Add missing auth command tests 2026-05-04 22:02:00 +02:00
Piotr Karbowski b1e28a8ae6 Added match_existing_path_case option (#335)
When enabled, existing path components are reused even if Tidal returns
different casing. This avoids creating separate paths on case-sensitive
filesystems that would conflict later when moved to case-insensitive systems.
For example, if "FooBar" already exists and the API returns "foobar",
downloads will continue under "FooBar".

Co-authored-by: Piotr Karbowski <git.throwaway941@simplelogin.com>
2026-04-25 00:55:02 +02:00
Filip Voska cf0d1cd362 fix: handle null/missing fields in Video API responses (#295)
* fix: handle null/missing fields in Video API responses

Tidal's API returns some Video objects (lyric/visualiser videos on
artist pages) with fields that don't match the current strict models:

- `imageId` can be null instead of a string
- The nested `album` object can be present but missing `id`, `title`,
  and `cover`

These validation failures cause the entire `ArtistVideosItems` page
to be rejected by Pydantic before any video can be parsed, resulting
in 0 downloads when targeting an artist with `--videos`.

A second independent bug causes an `AttributeError` on every video:
the default template `{album.artist}/{album.title}/{item.title}` is
shared with videos, but many videos have no album. When `album=None`
is passed to `format_template`, Python's `str.format()` evaluates
`None.artist` and raises `AttributeError: 'NoneType' object has no
attribute 'artist'`, which is caught and printed as an error for
every single video.

Fix:
- `resources.py`: make `Video.imageId` and `Video.Album.{id,title,
  cover}` optional so incomplete API responses pass validation
- `format.py`: give `AlbumTemplate` field defaults so it can be
  instantiated empty; use `AlbumTemplate()` as fallback instead of
  `None` when no album is present, so `{album.*}` tokens render as
  empty strings rather than raising AttributeError
- `download/__init__.py`: guard `video.album.id` accesses against
  `None` (now possible after the model fix) in both video code paths

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* test: add tests for Video model null fields and AlbumTemplate fallback

Covers the two bugs fixed in the previous commit:

- Video model accepts null/missing imageId and partial album objects
- format_template does not raise AttributeError when album is None
  and the template references {album.*} tokens

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 14:35:33 +01:00
Oskar Dudziński 96fb746fd9 New metadata.album_review config setting (#216)
* add `get_album_review` endpoint

* add `metadata.album_review` config option

* add comment to `add_track_metadata`

* move `AlbumReview` model to its own file and clean up imports

* fix API endpoint for fetching album reviews

* add normalized_text method to AlbumReview model for text processing

* add unit test for `normalize_review_text` function and refactor `AlbumReview` model

* add `album_review` to metadata

* update comment

* add comment
2025-11-13 13:38:04 +01:00
Oskar Dudziński e0fe7e1655 🐛 Fixed matching URLs when using url command (#215)
* refactor `from_string` method to improve resource type extraction logic
2025-11-12 23:37:41 +01:00
Oskar Dudziński b87888536e tiddl3 (#194) 2025-11-08 15:18:44 +01:00
Oskar Dudziński 01eeff3cac 🚀 2.8.0 (#182)
* bump version

* remove testing, add venv instructions, formatting

* remove tests and examples
2025-11-04 20:52:56 +01:00
Oskar Dudziński 12a2d4cf5f Added mix downloading 2025-09-29 19:45:05 +02:00
Oskar Dudziński 7258df8ec8 Added embedding lyrics to tracks (#129)
* add lyrics api endpoint

* embed lyrics in metadata

* add embed lyrics option
2025-06-03 16:40:14 +02:00
oskvr37 c183c37124 add video to TidalResource 2025-02-08 16:28:52 +01:00
Oskar Dudziński 2dcae191da Prepare for video downloading (#81)
* add video fetching to api
* add video parsing
* add video download example
2025-02-06 21:18:20 +01:00
Oskar Dudziński 5e02815e69 Add credits to metadata (#77)
 close #73
2025-02-05 20:20:24 +01:00
oskvr37 e5b38fb537 ♻️ close #57 2025-01-27 21:38:47 +01:00
oskvr37 ef231d7c1b add get eps and singles test 2025-01-27 18:05:06 +01:00
oskvr37 a702043d37 add getArtist test 2025-01-27 18:01:08 +01:00
oskvr37 0eb68e2d03 🏷️ remove models.track, add models.constants 2025-01-27 17:42:39 +01:00
oskvr37 106fe0609a add more FormatTrack tests 2025-01-23 23:40:11 +01:00
oskvr37 5eac4598f5 #68 #69 2025-01-23 19:26:03 +01:00
oskvr37 cb7d57be3b update TidalResource with pydantic 2025-01-21 17:57:29 +01:00
oskvr37 958b572b86 update code to new config 2025-01-20 22:18:45 +01:00
oskvr37 aec889c57d add formatTrack 2025-01-20 14:18:56 +01:00
oskvr37 44d5917006 add search 2025-01-13 23:38:23 +01:00
oskvr37 7d803a929d add TidalResource parser 2025-01-01 21:20:03 +01:00
oskvr37 a5187836b1 add tests 2024-12-29 22:28:04 +01:00