Commit Graph

57 Commits

Author SHA1 Message Date
Alok Saboo
60d60eacfb Merge branch 'master' into tidal-coverart 2026-06-27 10:11:11 -04:00
Šarūnas Nejus
609f83e338 tidal: Add missing return types in TidalPlugin 2026-06-27 09:20:38 +01:00
Šarūnas Nejus
3171334f4d Add docs 2026-06-27 09:03:36 +01:00
Šarūnas Nejus
ccccdef8b8 Extract shared Tidal attributes type
- Factor common album and track Tidal fields into a shared
  MediaAttributes TypedDict.
- Use the shared type in parser helpers that only need common Tidal
  metadata.
2026-06-27 09:03:36 +01:00
Sebastian Mohr
4e6e49d9c2 Removed a return. Still a bit complicated but
I don't think there is a way to further optimize.
2026-06-24 14:13:57 -04:00
Alok Saboo
01b12dca3b rename CoverArt types to Artwork to match Tidal API 2026-06-24 14:10:11 -04:00
Alok Saboo
26d90bbcfa make cover_art_by_id required and remove broken fallback URL 2026-06-24 14:10:10 -04:00
Alok Saboo
d26cfdedbc fix cover art types and parsing to match API response 2026-06-24 14:03:58 -04:00
Alok Saboo
28fa210422 tidal: fix mypy docref and dict access
- 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
2026-06-24 14:03:58 -04:00
Alok Saboo
23d4edc4d7 tidal: fix mypy errors in cover art parsing
- Make CoverArtAttributes.url NotRequired

- Use direct index access on TypedDict instead of .get() to avoid mypy Never-type inference
2026-06-24 14:03:58 -04:00
Alok Saboo
659ee7df0b add cover art support 2026-06-24 14:03:56 -04:00
Šarūnas Nejus
8fe9c2e576 Set albumtypes instead of albumtype 2026-06-24 16:44:10 +01:00
Šarūnas Nejus
368d2c0a6d Normalize albumtype 2026-06-24 16:44:10 +01:00
Sebastian Mohr
c71ac00f00 Fix auth URL not printed in environments without a
configured browser
2026-06-20 14:01:44 +02:00
Sebastian Mohr
379bbebbf1 Reverted attributes change. Not really in scope here and needs a bit more
refactoring to be consistent.
2026-06-19 10:39:14 +02:00
Šarūnas Nejus
cf73922cc6 Undo unrelated changes 2026-06-19 10:36:31 +02:00
Alok Saboo
81ce9b4481 simplify shared attribute typing 2026-06-17 14:03:53 -04:00
Alok Saboo
904839106c address reviewer comments 2026-06-17 11:47:01 -04:00
Alok Saboo
64b09c5a78 address reviewer comments 2026-06-17 10:51:14 -04:00
Alok Saboo
d855dbf55b lint issues 2026-06-17 10:31:24 -04:00
Alok Saboo
dcd54146d8 address reviewer comments 2026-06-17 09:45:02 -04:00
Alok Saboo
ab2a9ced63 Apply ruff formatting 2026-06-15 17:24:01 -04:00
Alok Saboo
5904dc280a Fix id_field, update tests, fix flake8 2026-06-15 17:08:34 -04:00
Sebastian Mohr
7fdcffea8d Proposal: Rewrote sync logic and split command again
Replace tidalsync() with sync_item_popularity() / sync_album_popularity()
backed by a shared _sync_popularity() helper.

Split the `tidal` command into `tidal` (auth-only) and `tidalsync`
(popularity sync with --item, --album, --force, --write flags). While
I liked the tidal [auth|sync] it is currently not well supported in beets
and e.g. help pages are lacking.

Accept int IDs throughout the search pipeline to avoid unnecessary
str conversions.
2026-06-15 21:58:56 +02:00
Alok Saboo
b85e5ec59d fix mypy: use explicit if-guard for album_result 2026-06-15 13:41:34 -04:00
Alok Saboo
4cd996cc0e apply ruff formatting 2026-06-15 13:18:15 -04:00
Alok Saboo
4a0b2beeef address reviewer comments: simplify _parse_popularity, fix flake8 E501 2026-06-15 13:00:59 -04:00
Alok Saboo
a6bf76b232 address reviewer comments: type _parse_popularity with attributes, add album popularity to sync 2026-06-15 11:38:12 -04:00
Alok Saboo
2f434b2b93 address reviewer comments 2026-06-15 09:45:35 -04:00
Alok Saboo
bed1f024b0 Fix tests and mypy error
- Use self.add_item() instead of self.lib.add_item() in tests
- Fix mypy: add isinstance(val, int) check in _popularity()
- Apply ruff formatting
2026-06-14 16:36:19 -04:00
Alok Saboo
98681406af tidal: add flexattrs and tidalsync command
- Add item_types ClassVar with tidal_track_id, tidal_album_id,
  tidal_artist_id, tidal_track_popularity, tidal_alb_popularity,
  tidal_updated fields
- Populate flexattrs during album/track import via AlbumInfo/TrackInfo
  kwargs
- Add beet tidalsync command to refresh popularity data post-import
- Add tidal fields to REIMPORT_FRESH_FIELDS_ITEM for reimport support
- Add tests for flexattr population and tidalsync behavior
- Update tidal plugin docs with attribute reference and tidalsync usage
2026-06-14 13:44:16 -04:00
Šarūnas Nejus
648f24cbc2 Enable and fix flake8-builtins 2026-06-09 00:14:06 +01:00
Šarūnas Nejus
d53ee774a9 Enable and fix flake8-return 2026-06-09 00:14:06 +01:00
Šarūnas Nejus
29580d2f00 Import everything from parent beets.autotag 2026-06-02 08:57:35 +01:00
Sebastian Mohr
adfb73b66d Run ruff format 2026-05-20 16:53:06 +02:00
Šarūnas Nejus
30ab81eb5b Extract UserError from beets.ui to a new beets.exceptions module.
Update all references in core, plugins, and tests to import UserError
from the new location. This centralizes exception handling and improves
code organization.
2026-05-16 11:18:51 +01:00
Sebastian Mohr
eaf1f00424 warning instead of raising errors. 2026-04-20 20:55:47 +02:00
Sebastian Mohr
aa18e2e4e8 Auth flow should open browser if possible. 2026-04-20 20:55:47 +02:00
Sebastian Mohr
7509fca2ca Moved beets ui import to top. 2026-04-20 20:55:47 +02:00
Sebastian Mohr
55da1cb5a5 Use get_json where applicable and simplified iso 8601 parsing. 2026-04-20 20:55:47 +02:00
Sebastian Mohr
815dce4b3e renamed hashmaps to *_by_id from *_lookup 2026-04-20 20:55:47 +02:00
Sebastian Mohr
830c14a5bb Added retry logic to TidalSession and added RequestHandler abstraction
to api layer.
2026-04-20 20:55:47 +02:00
Sebastian Mohr
2afa774126 Move auth flow to use requests-oauth. 2026-04-20 20:55:47 +02:00
Sebastian Mohr
2c24b93ca7 Another subset of review comments from @snejus:
- Renamed _extract_* methods to _parse_*
- Renamed release to date_parts
- Using .get instead of .request("GET"...)
2026-04-20 20:55:47 +02:00
Sebastian Mohr
b9949ccae5 A subset of review comments from @snejus:
- Renamed id to _id
- Aligned line breaks for some comment with actual ruff line length
- Removed comment dividers
- Removed a number of unnecessary or duplicate comments
2026-04-20 20:55:47 +02:00
Sebastian Mohr
ad79dc2047 super requests already raises. 2026-04-20 20:55:47 +02:00
Sebastian Mohr
199d84655b Added state verify step in authentication function. Not that is needed but
a good thing to have.
2026-04-20 20:55:47 +02:00
Sebastian Mohr
a585df514b Added batching for max filter size. 2026-04-20 20:55:47 +02:00
Sebastian Mohr
996d2eaf36 First iteration of reviews:
- too strict ids
- typos and docstring improvements
2026-04-20 20:55:47 +02:00
Sebastian Mohr
1569810427 Added candidate method implementations methods: Required a slight
amount of refactoring but im more happy with the abstraction now.
2026-04-20 20:55:47 +02:00