Commit b13a4fa
authored
Tidal Metadata Plugin (#6520)
## Description
This PR introduces tidal as metadatasource. It add both an minimal api
layer and the typical metadata source plugin capabilities.
### Details
The implementation provides a small API layer consisting of `TidalAPI`
for high-level album and track fetching, and `TidalSession` which
extends `requests.Session` with token authentication, automatic rate
limiting (~4 req/s via `RateLimitAdapter`), and pagination resolution
following the JSON:API spec.
Authentication is handled through an OAuth2 PKCE flow accessible via
`beet tidal --auth`, with automatic token refresh when the access token
expires.
Metadata parsing handles Tidal's JSON:API response format, extracting
album and track information including ISO 8601 duration conversion,
artist relationships, and copyright/label data.
## Input wanted
The API layer currently lacks comprehensive test coverage. Setting up
proper tests would require either mocking all outgoing requests or
creating a dedicated test token (which necessitates an account and might
require read/write to github secrets).
Are we comfortable with the current approach of unit testing the plugin
itself while mocking all requests?
## TODOs
- [x] Documentation
- [x] `candidate` and `item_candidates` lookup
- [x] It should be possible to optimize batched lookups
- [x] Add tests for candidates and item_candidates
- [x] Implement batching for more than 20 filters
## Refs
thanks to @jcjordyn130 for his initial implementations in #5637 and
#464114 files changed
Lines changed: 1795 additions & 1 deletion
File tree
- .github
- beetsplug
- _utils
- tidal
- beets/util
- docs
- plugins
- test
- plugins
- utils
- util
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
103 | 104 | | |
104 | 105 | | |
105 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
106 | 139 | | |
107 | 140 | | |
108 | 141 | | |
| |||
0 commit comments