Commit graph

12222 commits

Author SHA1 Message Date
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
Katelyn Dickey
2c43adf463
Fix album store method to cascade flex field deletions to items 2023-01-31 01:31:53 -05:00
J0J0 Todos
527052e13d
Merge branch 'master' into splupdate_dry_run 2023-01-31 07:07:09 +01:00
J0J0 Todos
6abcc20df0
Merge pull request #4634 from ghbrown/discogs_s_ic
Implement item_candidates for Discogs plugin
2023-01-31 06:24:05 +01:00
ghbrown
429dfb3e7a Fix docs phrasing; fix changelog formatting 2023-01-28 18:11:22 -06:00
Adrian Sampson
cc33c9c8b8
Merge pull request #4647 from Steffo99/definition-list
Use definition lists with the plugins' names in the documentation
2023-01-26 15:23:47 -08:00
Adrian Sampson
3ba973de31
Merge pull request #4646 from Steffo99/docs-plugin-discogs
Improve formatting in the `plugins/discogs` documentation page
2023-01-26 15:23:36 -08:00
Adrian Sampson
cf37ee37e5
Merge pull request #4645 from Steffo99/docs-plugin-plexupdate
Improve formatting in the `plugins/plexupdate` documentation page
2023-01-26 15:22:59 -08:00
Adrian Sampson
6aa562e2ae
Merge pull request #4650 from jcjordyn130/patch-1
config.rst: Remove extraneous for
2023-01-26 08:55:56 -08:00
Stefano Pigozzi
e76fe01212
Add missing space 2023-01-22 15:02:18 +01:00
Stefano Pigozzi
2b600fa151
Revert the configuration section back to how it was before 2023-01-22 14:56:23 +01:00
Stefano Pigozzi
566579b5f8
Revert the configuration section back to how it was before 2023-01-22 14:37:45 +01:00
Stefano Pigozzi
cf56d05204
Move changelog entry to other changes 2023-01-22 14:16:39 +01:00
Jordyn
7f3f522973
config.rst: Remove extraneous for 2023-01-21 22:08:03 -06:00
ghbrown
47fe387de1 Docs and changelog 2023-01-21 20:56:44 -06:00