Commit graph

4106 commits

Author SHA1 Message Date
J0J0 Todos
6e28672474 lastgenre_aliases
- Use the INI format (since YAML and regex is a nightmare...)
- Ship a default aliases file with beets
  - Dont use non-capturing groups use ?: because colons are a problem.
    Also some replacement patterns were bad. Fixed
- Implement loading the aliases.ini file similar to how the whitelist
  file is handled.
- Apply aliases in two places, right after last.fm fetch and after
  collecting existing genres.
2025-09-25 21:56:32 +02:00
J0J0 Todos
0a26202a1d lastgenre_pretend_refactor 2025-09-25 19:59:06 +02:00
Finn
29f55f9911
Merge branch 'master' into metadata_option 2025-09-24 22:02:28 -04:00
Finn
61b632f2b4 Add option to not write metadata 2025-09-24 21:52:57 -04:00
Šarūnas Nejus
787d9b4a40
Merge branch 'master' into discogs-disambiguation-fix 2025-09-22 21:50:34 +01:00
Trey Turner
f0a6059685 feat(FtInTitle): support tracks by artists != album artist 2025-09-21 22:27:11 +01:00
henry
e577df0f25
Merge branch 'master' into discogs-disambiguation-fix 2025-09-21 09:34:12 -07:00
Sebastian Mohr
34114fe915 New import location for art.py 2025-09-21 08:01:48 -07:00
Sebastian Mohr
3fd49a7de8 Moved arts.py file into beetsplug namespace as it is not used in core. 2025-09-21 08:01:48 -07:00
Alok Saboo
c7ee0e326c Add prefix to log messages for genre fetching in LastGenrePlugin 2025-09-21 07:07:14 +02:00
Alok Saboo
0be4cecf82 Update beetsplug/lastgenre/__init__.py
Co-authored-by: Šarūnas Nejus <snejus@protonmail.com>
2025-09-21 07:07:14 +02:00
Alok Saboo
5e6dd674a9 Update beetsplug/lastgenre/__init__.py
Co-authored-by: Šarūnas Nejus <snejus@protonmail.com>
2025-09-21 07:07:14 +02:00
Alok Saboo
84986dc42d Enhance lastgenre plugin: add item.try_write() for write operations and improve documentation clarity 2025-09-21 07:07:14 +02:00
Alok Saboo
a57ef2cb3b Add --pretend option to lastgenre plugin for previewing genre changes 2025-09-21 07:07:14 +02:00
Sebastian Mohr
a796d6d799 New import location for art.py 2025-09-20 14:01:38 +02:00
Sebastian Mohr
28aee0fde4 Moved arts.py file into beetsplug namespace as it is not used in core. 2025-09-20 14:01:38 +02:00
Henry
8a21bacd14 Add type check 2025-09-19 21:00:37 -07:00
Henry
dda265dc77 Disambiguation fix implemented & tested 2025-09-19 20:46:07 -07:00
Henry Oberholtzer
24fbc566f6 initial changes, changelog adjusted, TODO: test for various artists and update docs 2025-09-20 01:58:56 +02:00
Sebastian Mohr
efbfc23931 Removed config options and fixed a bug with beet spotify command 2025-09-19 17:20:51 +02:00
Sebastian Mohr
c7ba399dd1 fix incorrect matches when album is missing or empty
closes #5189
2025-09-19 17:20:51 +02:00
Rebecca Turner
a302b6d9c2 fromfilename: Don't crash if title is missing
Prevents this crash:

```
$ beet import ~/Music/Music/_/[1405]/00.mp3
Traceback (most recent call last):
  File "/nix/store/lfv9ns20hz2bg6d44js378vcxjfm9261-beets-2.3.1/bin/.beet-wrapped", line 9, in <module>
    sys.exit(main())
             ~~~~^^
  File "/nix/store/lfv9ns20hz2bg6d44js378vcxjfm9261-beets-2.3.1/lib/python3.13/site-packages/beets/ui/__init__.py", line 1859, in main
    _raw_main(args)
    ~~~~~~~~~^^^^^^
  File "/nix/store/lfv9ns20hz2bg6d44js378vcxjfm9261-beets-2.3.1/lib/python3.13/site-packages/beets/ui/__init__.py", line 1838, in _raw_main
    subcommand.func(lib, suboptions, subargs)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/lfv9ns20hz2bg6d44js378vcxjfm9261-beets-2.3.1/lib/python3.13/site-packages/beets/ui/commands.py", line 1390, in import_func
    import_files(lib, byte_paths, query)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/lfv9ns20hz2bg6d44js378vcxjfm9261-beets-2.3.1/lib/python3.13/site-packages/beets/ui/commands.py", line 1330, in import_files
    session.run()
    ~~~~~~~~~~~^^
  File "/nix/store/lfv9ns20hz2bg6d44js378vcxjfm9261-beets-2.3.1/lib/python3.13/site-packages/beets/importer/session.py", line 234, in run
    pl.run_parallel(QUEUE_SIZE)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/nix/store/lfv9ns20hz2bg6d44js378vcxjfm9261-beets-2.3.1/lib/python3.13/site-packages/beets/util/pipeline.py", line 471, in run_parallel
    raise exc_info[1].with_traceback(exc_info[2])
  File "/nix/store/lfv9ns20hz2bg6d44js378vcxjfm9261-beets-2.3.1/lib/python3.13/site-packages/beets/util/pipeline.py", line 336, in run
    out = self.coro.send(msg)
  File "/nix/store/lfv9ns20hz2bg6d44js378vcxjfm9261-beets-2.3.1/lib/python3.13/site-packages/beets/util/pipeline.py", line 219, in coro
    func(*(args + (task,)))
    ~~~~^^^^^^^^^^^^^^^^^^^
  File "/nix/store/lfv9ns20hz2bg6d44js378vcxjfm9261-beets-2.3.1/lib/python3.13/site-packages/beets/importer/stages.py", line 141, in lookup_candidates
    plugins.send("import_task_start", session=session, task=task)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/lfv9ns20hz2bg6d44js378vcxjfm9261-beets-2.3.1/lib/python3.13/site-packages/beets/plugins.py", line 505, in send
    result = handler(**arguments)
  File "/nix/store/lfv9ns20hz2bg6d44js378vcxjfm9261-beets-2.3.1/lib/python3.13/site-packages/beets/plugins.py", line 200, in wrapper
    return func(*args, **kwargs)
  File "/nix/store/lfv9ns20hz2bg6d44js378vcxjfm9261-beets-2.3.1/lib/python3.13/site-packages/beetsplug/fromfilename.py", line 165, in filename_task
    apply_matches(d, self._log)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^
  File "/nix/store/lfv9ns20hz2bg6d44js378vcxjfm9261-beets-2.3.1/lib/python3.13/site-packages/beetsplug/fromfilename.py", line 124, in apply_matches
    item.title = str(d[item][title_field])
                     ~~~~~~~^^^^^^^^^^^^^
KeyError: 'title'
```
2025-09-18 14:57:48 +02:00
J0J0 Todos
e59521e375 lastgenre: tree/whitelist: Remove experimental
experimental, even though a tag last.fm very often returns (in top 20
tag charts!), it is too broad of a term to be pinned downed with any
particular genre, thus can't really be used for canonicalization.
2025-09-13 09:29:43 +02:00
J0J0 Todos
a98ba061e8 lastgenre: tree/whitelist: UK/Breakbeat Hardcore
Also changes decided during PR discussions and more research.
2025-09-13 09:29:43 +02:00
J0J0 Todos
9f442dcf75 lastgenre: tree/whitelist: Contributor feedback
that came up in the pull request comments and other discussions.
2025-09-13 09:29:43 +02:00
J0J0 Todos
4949f44e82 lastgenre: tree/whitlist: Jojo's essential fixes
Fixes to the beets default tree and whitlist files I collected over the
years; Includes Tags last.fm returns quite often; Also the
chart.getTopTags API endpoint was checked to make sure the top 100
charts are included in beets default tree and whitelist.
2025-09-13 09:29:43 +02:00
J0J0 Todos
7a5cfa8f46 lastgerne: Update wl/tree load methods docstrings 2025-09-10 07:36:47 +02:00
J0J0 Todos
d2caed3971 lastgenre: Also log which whitelist file is loading 2025-09-10 07:36:47 +02:00
J0J0 Todos
6601cbf8c0 lastgenre: canonical/whitelist setting None load default files 2025-09-10 07:36:47 +02:00
J0J0 Todos
6bc30eaf18 lastgenre: Add docstrings to file load methods 2025-09-10 07:36:47 +02:00
J0J0 Todos
6da72beeb0 lastgenre: Add expanduser to whitelist/tree load 2025-09-10 07:36:47 +02:00
J0J0 Todos
81d342b79f lastgenre: Simplify default tree loading 2025-09-10 07:36:47 +02:00
J0J0 Todos
c54a54682f lastgenre: Use pathlib and simplify whitelist load
- Read the whole file using Path().read_text()
- Strip whitespace and lower() transform

Drawbacks:

- Normalization gets lost (normpath did that)
2025-09-10 07:36:47 +02:00
J0J0 Todos
fbd90b0507 lastgenre: Use pathlib for opening tree file
instead of syspath(normpath())

Co-authored-by: Šarūnas Nejus <snejus@protonmail.com>
2025-09-10 07:36:47 +02:00
J0J0 Todos
0cdb1224b9 lastgenre: Fix c14n load log msg format 2025-09-10 07:36:47 +02:00
J0J0 Todos
bbde63d87e lastgenre: Accept AI suggested use open() for tree file
instead of codecs.open(), which most probably is a relict of beets' Python2/3 compatibility area.

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
2025-09-10 07:36:47 +02:00
J0J0 Todos
a98fa054fe lastgenre: Fix failing CI tests by using syspath
when loading c14n file.
2025-09-10 07:36:47 +02:00
J0J0 Todos
5ff88b46cf lastgenre: Fix another mypy error in c14n load
(that was only happening in CI and not by local poe check-types)
2025-09-10 07:36:47 +02:00
J0J0 Todos
8ae29e42bf lastgenre: Fix mypy errors in file load methods 2025-09-10 07:36:47 +02:00
J0J0 Todos
6ed17912b4 lastgenre: Fix _load_whitelist return type bytes 2025-09-10 07:36:47 +02:00
J0J0 Todos
bf903fc27d lastgenre: Move file loading to helpers
and add return types.
2025-09-10 07:36:47 +02:00
Sebastian Mohr
e51de5de91 Removed data source as listenbrainz is not an metadata source plugin.
closes #5975
2025-09-04 17:41:12 +02:00
Šarūnas Nejus
17bc11034f
Limit search query results using request parameters 2025-09-01 04:36:54 +01:00
Šarūnas Nejus
20497d3d9b
Dedupe search_limit config option init 2025-09-01 04:10:53 +01:00
Šarūnas Nejus
a674fd3095
musicbrainz: Rename searchlimit config option to search_limit 2025-08-31 18:48:46 +01:00
Šarūnas Nejus
d00d51e0bf
Add configurable search_limit to Spotify and Deezer plugins 2025-08-31 18:48:46 +01:00
Šarūnas Nejus
44fda7ca0a
lyrics: use another beatles song for Lyricsmode
Lady Madonna apparently is gone from this website. ¯\_(ツ)_/¯
2025-08-30 23:10:22 +01:00
Šarūnas Nejus
b3d434f58f
Delegate attribute access to logging 2025-08-30 23:10:21 +01:00
Šarūnas Nejus
e334e81d40
Use item.filepath instead of displayable_path in logging 2025-08-30 23:10:21 +01:00
Šarūnas Nejus
d6b6ac3387
Replace logging f-strings with arguments 2025-08-30 23:10:21 +01:00