tidal: add cover art support via coverArt relationship#6743
Open
arsaboo wants to merge 8 commits into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6743 +/- ##
==========================================
+ Coverage 74.60% 74.62% +0.01%
==========================================
Files 163 163
Lines 20830 20844 +14
Branches 3283 3287 +4
==========================================
+ Hits 15541 15555 +14
Misses 4538 4538
Partials 751 751
🚀 New features to boost your workflow:
|
- Make CoverArtAttributes.url NotRequired - Use direct index access on TypedDict instead of .get() to avoid mypy Never-type inference
- Fix mypy: avoid {} default in relationships.get() that creates Never type
- Fix doc build: use :doc:\etchart\ instead of :doc:\plugins/fetchart\ from within plugins/ directory
semohr
reviewed
Jun 15, 2026
semohr
reviewed
Jun 15, 2026
semohr
requested changes
Jun 18, 2026
| visualMetadata: NotRequired[dict[str, str]] | ||
|
|
||
|
|
||
| class TidalCoverArt(TypedDict): |
Contributor
There was a problem hiding this comment.
Lets name all these typeddict consistent with the tidal api and use Artwork instead of CoverArt.
|
|
||
| @staticmethod | ||
| def _parse_cover_art_url( | ||
| album: TidalAlbum, cover_art_by_id: dict[str, TidalCoverArt] |
Contributor
There was a problem hiding this comment.
A bit more compact and less readable ;)
for item in album["relationships"].get("coverArt", {}).get("data", []):
if item.get("type") == "artworks" and (files := cover_art_by_id.get(item.get("id"), {}).get("attributes", {}).get("files")):
return files[0].get("href") if files else None
return None| "links": {}, | ||
| }, | ||
| }, | ||
| "relationships": relationships, # type: ignore[typeddict-item] |
Contributor
There was a problem hiding this comment.
Let's not introduce a type ignore please. We should be able to type this with
dict[str, RelationshipData].
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Include
coverArtin album API requests and parse thecoverArtsresources from the included array. Thecover_art_urlis passed toAlbumInfo(cover_art_url=...), which the fetchart plugin uses to retrieve album art. Falls back to constructing a URL from the cover art resource ID when no direct URL is available in the API response.docs/to describe it.)docs/changelog.rstto the bottom of one of the lists near the top of the document.)cc: @semohr This is the first PR. I will add another one for
popularitysoon.