Commit graph

10885 commits

Author SHA1 Message Date
J0J0 Todos
0175a9aed8 Introduce new module beets.util.id_extractors
- We introduce a new submodule of beets.util named id_extractors.
- Parts of the ID extraction utilites required by metadata source plugins
  should live there.
- Also this enables future usage of those utilities from the "outside" of
  metadata source plugins.
- Move Discogs ID extractor to the new module and change test_discogs to use
  the new location.
- Add spotify_id_regex variable to the new module.
2023-03-08 18:12:31 +01:00
J0J0 Todos
8bbaefbdc9
Merge pull request #4643 from Steffo99/sphinx-deps 2023-03-08 16:58:48 +01:00
Stefano Pigozzi
87c43a0b88
Merge remote-tracking branch 'upstream/master' into sphinx-deps 2023-03-08 13:43:22 +00:00
J0J0 Todos
1f9113af73
Merge pull request #4582 from jpluscplusm/jcm_fix_albumtypes
Store `albumtypes` multi-value field consistently in-DB & in-tag, preventing continual file re-tagging
2023-03-08 14:26:19 +01:00
J0J0 Todos
74ac6c4cdc
Merge pull request #4694 from arsaboo/add_plexsync
Add plexsync plugin
2023-03-08 13:32:25 +01:00
Alok Saboo
033f63ad47 Add Github link 2023-03-07 17:18:15 -05:00
Alok Saboo
4c62673e41 Update index.rst 2023-03-07 17:12:11 -05:00
Adrian Sampson
d63bebb113
Merge pull request #4690 from JOJ0/changelog_note_ordering
Improve "Changelog goes here note" in changelog.rst
2023-03-05 18:52:58 -08:00
J0J0 Todos
6336fef1e8 Improve "Changelog goes here note" in changelog.rst 2023-03-04 19:52:03 +01:00
Adrian Sampson
650f710943
Merge pull request #4686 from arsaboo/spotify_fix
Fix Spotify error - added exception for TypeError [small PR]
2023-03-02 19:27:23 -08:00
Alok Saboo
823599f2b4 Update changelog 2023-02-28 18:18:42 -05:00
Alok Saboo
abf6b1e1f3 Update spotify.py 2023-02-28 09:38:23 -05:00
Alok Saboo
c73ecb89d3 Update spotify.py 2023-02-28 09:36:16 -05:00
J0J0 Todos
4908e1ae09 Fix flake8 issues in test_ui.py
that were introduced in 27218a94.
2023-02-28 09:24:30 +01:00
J0J0 Todos
78853cc9c2 Add note to albumtypes plugin docs about #4528
Add a note to the docs of the albumtypes plugin warning about issue #4528 and
linking to the manual fixing description.
2023-02-28 08:53:21 +01:00
J0J0 Todos
7be1eec762 Rewrite changelog entry for #4583
and include linking to manual fixing tutorial.
2023-02-28 08:51:58 +01:00
J0J0 Todos
93fa19f493 Fix albumtypes plugin and its tests
The new database type DelimitedString does list to string and vice versa
conversions itself.
2023-02-27 13:43:03 +01:00
Jonathan Matthews
27218a9490 Mark albumtype/s expected test failure as fixed 2023-02-27 13:43:03 +01:00
J0J0 Todos
cd52a05d3a Add fix for #4528 to changelog 2023-02-27 13:42:45 +01:00
Jonathan Matthews
7cfc39ea27 Realign with known-working code after review by @mkhl
@mkhl was kind enough to do a drive-by review of my proposed changes,
which I'll include here as the GitHub URI may bit-rot over time (it's
technically
[here](bc21caa0d5),
but that commit isn't part of the `beets` repo, so may get GC'd).

I've encorporated all their proposed changes, as their code is being run
against an existing Beets library, whereas my changes were made as I
tried to set up Beets for the first time - thus I'm inclined to trust
their known-working code more than my own!

This is a review starting at
bc21caa0d5 (diff-d53f73df7f26990645e7bdac865ef86a52b67bafc6fe6ad69890b510a57e2955R210)
(`class DelimeteredString(String):`)

> for context this is the version i'm using now:
>
> ```python
> class DelimitedString(String):
>     model_type = list
>
>     def __init__(self, delimiter):
>         self.delimiter = delimiter
>
>     def format(self, value):
>         return self.delimiter.join(value)
>
>     def parse(self, string):
>         if not string:
>             return []
>         return string.split(self.delimiter)
>
>     def to_sql(self, model_value):
>         return self.delimiter.join(model_value)
> ```
>
> i think 'delimited string' is the correct term here
>
> the rest of the code doesn't seem to use many abbreviations, so calling the property `delimiter` seems appropriate
>
> i don't think a default value for the delimiter makes a lot of sense?
>
> the list comprehension and string conversions in `to_sql` don't seem necessary to me, see above. did you run into trouble without them?
>
> the `from_sql` seems to just be missing functionality from the `Type` parent and seems completely unnecessary
>
> `parse` shouldn't be able to fail because at that point, we've ensured that its argument is actually a string. i also added a `if not string` condition because otherwise the empty list of album types would turn into the list containing the empty string (because that's what split returns)
>
> if we don't define a `format` method here we print the internal python representation of the values (i.e. `['album', 'live']` or somesuch) in the `beet write` output. joining on the delimiter nicely formats the output :)
>
> just so i don't ping you twice unnecessarily, i think it's better to instantiate this type with `'; '` (semicolon space) as the delimiter, because that's what was used before to join the albumtypes and what we'll find in the database

All these changes have been made, including the switch from `;` to
`;<space>` as the in-DB separator.
2023-02-27 13:28:29 +01:00
Jonathan Matthews
af65c6d707 Serialise albumtypes field as a semicolon-based DelimeteredString 2023-02-27 13:28:29 +01:00
Jonathan Matthews
41f9ecc73b Introduce new DB type: DelimeteredString 2023-02-27 13:28:29 +01:00
wisp3rwind
7aa7df2a93 Merge branch 'pr_autotag_typing_fixes' 2023-02-22 20:04:35 +01:00
J0J0 Todos
2b285c72a5
Merge pull request #4636 from trolley/topic/deprecate-acousticbrainz
Deprecate `absubmit` and `acousticbrainz` plugins
2023-02-21 17:42:25 +01:00
Adrian Sampson
1ccad26437
Merge pull request #4678 from beetbox/tutorial-link
Docs: Add a link to the walkthrough from the main tutorial guide
2023-02-20 17:56:45 -08:00
Mark Trolley
55255b0087
Deprecate absubmit and update acousticbrainz plugins
Fixes #4627.

AcousticBrainz is shutting down as of early 2023. Deprecate the absubmit
plugin and update the acousticbrainz plugin to require configuration of
an AcousticBrainz server instance.
2023-02-20 17:42:07 -05:00
wisp3rwind
c389087319 autotag: style fixes 2023-02-19 13:32:52 +01:00
wisp3rwind
0b4091166a typing: fixes according to mypy for autotag.*
tighten/loosen/fix some types as required and to the extent that we're
actually able to name the relevant types. Used a bunch of `cast(T, value)`
to help the type checker, in particular around confuse (that should probably
be fixed by typing confuse) and around getters for Item fields (not sure
whether we can do anything about that. We could add runtime checks (but what
the error handling do?))
2023-02-19 13:08:14 +01:00
wisp3rwind
5a2ce43fa8 Merge branch 'serene_arc_autotag_typings' 2023-02-19 11:58:59 +01:00
Benedikt
22ca6eff82
Merge pull request #4374 from wisp3rwind/pr_drop_old_python
Drop Python 3.6, some Python 2 + Python <= 3.6 cleanup
2023-02-19 10:19:36 +01:00
Serene-Arc
11a797fb94 Fix typing 2023-02-19 17:51:12 +10:00
Adrian Sampson
0f013f53ef
Link to walkthrough on blog
Closes #4382.
2023-02-18 20:37:48 -08:00
Adrian Sampson
36b6fb5498
Change some "read more" links 2023-02-18 20:33:16 -08:00
Adrian Sampson
c4b7bdfb70
Merge pull request #4677 from trolley/topic/fix-fetchart-suffix
Fix cover art archive fetching
2023-02-17 18:56:25 -08:00
Mark Trolley
13ce920fd1
Fix cover art archive fetching
PR #3748 changed the way cover art is fetched from the cover art
archive, but the manual addition of a `-` to the width suffix that was
needed when the image URI was being constructed manually was not
removed. Because of this the plugin would try to look up the property
under `thumbnails` that didn't exist (for example `-1200` instead of
`1200`), which would fail.
2023-02-17 19:01:20 -05:00
Serene-Arc
c0587cef31 Implement PEP 56v3 to avoid circular import 2023-02-16 16:59:01 +10:00
Serene-Arc
ef760feada Fix style errors 2023-02-13 13:51:40 +10:00
Serene-Arc
b33c3ce957 Fix some typings 2023-02-13 13:17:12 +10:00
Serene-Arc
24c0665142 Fix some typings 2023-02-13 10:00:06 +10:00
wisp3rwind
a666057fdf drop old Python: simplify and improve case_sensitive()
- some cleanup for recent Python which has samefile() on Windows
- also, fix this function by only upper-/lower-casing one path component
  at a time. It is unclear to me how this could have ever worked.
2023-02-12 16:16:43 +01:00
wisp3rwind
427bfe8cbf library/PathQuery: fix lower-casing 2023-02-12 16:16:43 +01:00
wisp3rwind
9052854e50 library/PathQuery: remove useless bytestring_path()
normpath already applies bytestring_path() to its output
2023-02-12 16:16:43 +01:00
wisp3rwind
e6fd038b0e tests: robustify path query / case_sensitive tests
- samefile exists on all platforms for recent python
- don't rely on monkey-patching os/os.path and on specifics on the
  implementation: as a result of doing so, the tests start failing in
  obscure ways as soon as the implementation (and its usage of
  os.path.exists and os.path.samefile) is changed
2023-02-12 16:16:43 +01:00
Benedikt
12e99f7cc6
Merge pull request #4675 from wisp3rwind/syspath_at_api_boundary
permissions: Move syspath conversion to the actual API boundary
2023-02-12 14:18:53 +01:00
wisp3rwind
12173d30a8 permissions: Move syspath conversion to the actual API boundary 2023-02-12 14:04:24 +01:00
Benedikt
0e29a4ffdc
Merge pull request #4579 from night199uk/fix_permissions
Avoid calling chmod in some scenarios.
2023-02-12 13:53:24 +01:00
night199uk
23598df155 Avoid calling chmod in some scenarios.
This guards the os.chmod calls so it's only called IF the
permissions need changing. This guards against an exception in
certain complex library setups.
2023-02-11 19:28:52 -08:00
J0J0 Todos
aabd1636aa
Merge pull request #4573 from JOJ0/splupdate_dry_run
Add --pretend option to splupdate command
2023-02-01 08:07:17 +01:00
Adrian Sampson
e504968e27
Merge pull request #4663 from katedickey/fix/cascade-flex-deletes
Fix album store method to cascade flex field deletions to items
2023-01-31 08:36:49 -08:00
Katelyn Dickey
f0359007a5
Code style fixes 2023-01-31 11:26:22 -05:00