Commit graph

10083 commits

Author SHA1 Message Date
Xavier Hocquet
8c6530369d
Merge branch 'master' into tekstowo-lyrics 2021-03-28 12:05:42 -06:00
Ryan Lanny Jenkins
39b5a7636c Add line in dev docs for new hook. 2021-03-27 12:04:25 -05:00
Ryan Lanny Jenkins
6c4cb82c03 badfiles: Respect any previous decision to skip an import and don't re-prompt the user. 2021-03-27 12:03:56 -05:00
Ryan Lanny Jenkins
1d4a2c3e2a Add a new hook for badfiles pre-import user interaction, instead of flagging the task. 2021-03-27 11:37:26 -05:00
Ryan Lanny Jenkins
9c17d9a924 linting 2021-03-24 17:29:16 -05:00
Ryan Lanny Jenkins
227d420efb Add entry to changelog. 2021-03-24 17:04:17 -05:00
Ryan Lanny Jenkins
3e1fe88053 Merge branch 'master' of https://github.com/beetbox/beets 2021-03-24 16:59:24 -05:00
Ryan Lanny Jenkins
2f8a8e2f8a Add docs for badfiles' check_on_import option. 2021-03-24 16:55:28 -05:00
Ryan Lanny Jenkins
2c9f3d6464 Add check_on_import config for badfiles. 2021-03-24 16:51:58 -05:00
Benedikt
854b4ab483
Merge pull request #3897 from wisp3rwind/py310
plugins: Python 3.10 compatibility
2021-03-24 18:49:27 +01:00
Adrian Sampson
f1e98972b3
Merge pull request #3899 from wisp3rwind/deprecate35
Warn about dropping Python 3.5 support in the changelog
2021-03-24 09:09:38 -04:00
Ryan Lanny Jenkins
e96b5a7eba Check files during import, show checker warnings and errors along with tagging choices. 2021-03-23 21:55:51 -05:00
wisp3rwind
7a0599efe2 Python 3.5 is EOL and we should drop support thus add notice to changelog
The final release 3.5.10 was on 2020-09-05
2021-03-23 19:41:29 +01:00
wisp3rwind
9a6b65351b Merge pull request #3560 from davidswarbrick/master
Album Art Resize to filesize
2021-03-23 12:15:51 +01:00
wisp3rwind
af70b75670 fetchart/artresizer: Improve comments & docstrings, avoid os.stat if
possible

slight enhancements on top of https://github.com/beetbox/beets/pull/3560
2021-03-23 12:04:30 +01:00
David Swarbrick
07b5e69f40 fetchart/artresizer: add max_filesize support (#3560)
Squashed from the PR, relevant commit messages follow below:

Added file size option to artresizer

 - In line with comments on PR, adjusted the ArtResizer API to add
   functionality to "resize to X bytes" through `max_filesize` arg

 - Adjustment to changelog.rst to include max_filesize change to ArtResizer
   and addition of new plugin.

Added explicit tests for PIL & Imagemagick Methods

 - Checks new resizing functions do reduce the filesize of images

Expose max_filesize logic to fetchart plugin

- Add syspath escaping for OS cross compatibility
- Return smaller PIL image even if max filesize not reached.
- Test resize logic against known smaller filesize (//2)
- Pass integer (not float) quality argument to PIL
- Remove Pillow from dependencies
- Implement "max_filesize" fetchart option, including
  logic to resize and rescale if maxwidth is also set.

Added tests & documentation for fetchart additions.

Tests now check that a target filesize is reached with a
higher initial quality (a difficult check to pass).

With a starting quality of 95% PIL takes 4 iterations to succeed
in lowering the example cover image to 90% its original size.
To cover all bases, the PIL loop has been changed to 5 iterations
in the worst case, and the documentation altered to reflect the
50% loss in quality this implies. This seems reasonable as users
concerned about performance would most likely be persuaded to
install ImageMagick, or remove the maximum filesize constraint.
The previous 30% figure was arbitrary.
2021-03-23 12:00:14 +01:00
wisp3rwind
64dc3ec2a2 plugins: Python 3.10 compatibility
In

766c8b190b from [1]

a slight hack was introduced that allowed to add new arguments to
plugin events without breaking legacy plugins that did not feature
those arguments in the signature of their handler functions.

When improving logging management for plugins in

327b62b610 from [2]

this hack was removed, to be restored with

7f34c101d7 from [3]

Now in addition to inspecting the function signature, an assumption is
made about the string message of the TypeError that occurs for legacy
handler functions (namely, that it start with func.__name__).

In Python 3.10, the TypeError uses func.__qualname__ [4], however, due
to the patch [5]. Thus, checking whether the TypeError is due to an
outdated function signature or something internal to the handler fais.

As a fix, instead of using __name__ or __qualname__ depending on Python
version, let's just revert to the old hack from [1], I'm not seeing a
significant advantage in [3].  The latter might be a bit faster since it
doesn't construct a new dict for each call, but only for legacy calls in
the excption handler. I doubt that really matters, and if it does, we
should try to think of a better fix than inspecting error messages with
no guarantees about their content in such a central place in the code.

[1] https://github.com/beetbox/beets/pull/652
[2] https://github.com/beetbox/beets/pull/1320
[3] https://github.com/beetbox/beets/pull/1359
[4] https://docs.python.org/3.10/glossary.html#term-qualified-name
[5] https://bugs.python.org/issue40679
2021-03-23 09:51:44 +01:00
Benedikt
fdd1deed22
Merge pull request #3896 from wisp3rwind/ci_nightly
ci: also run on latest Python alpha, but allow failure
2021-03-23 09:30:36 +01:00
wisp3rwind
78808e4654 ci: also run on latest Python alpha, but allow failure 2021-03-23 09:18:56 +01:00
Benedikt
8648e9b518
Merge pull request #3895 from wisp3rwind/ci_reduce_skips
ci: install ffmpeg for replaygain tests; show skipped tests
2021-03-23 09:00:26 +01:00
Adrian Sampson
2d9f0cc522
Merge pull request #3894 from wisp3rwind/setup_py_improvements
setup.py: add 3.9 classifier, add note about ffmpeg dep for replaygain
2021-03-22 19:51:45 -04:00
wisp3rwind
68fa03a5eb ci: install ffmpeg for replaygain tests; show skipped tests
We lost the ability to show skipped tests when transitioning to gh
actions. As it turns out, all of the replaygain tests were being
skipped, so as a start, try to install at least one backend.
2021-03-22 19:07:34 +01:00
wisp3rwind
89624cf0a1 setup.py: add 3.9 classifier, add note about ffmpeg dep for replaygain 2021-03-22 19:04:49 +01:00
Jack Wilsdon
2399a4215d
Merge pull request #3234 from jackwilsdon/fix-import-set-equals
Allow equals within import --set value
2021-03-22 16:23:43 +00:00
Jack Wilsdon
01bc32e50e Allow equals within import --set value 2021-03-22 15:26:14 +00:00
Adrian Sampson
d7c556f7d1
Remove stray cue plugin (fix #3892) 2021-03-20 09:04:03 -04:00
Benedikt
e5f1cca8a3
Merge pull request #3890 from wisp3rwind/pr_rg_import_fixes
replaygain: fix write/force flags on import
2021-03-18 22:42:42 +01:00
Benedikt
c8c73cc789
Merge pull request #3891 from wisp3rwind/pr_rg_de-nest
replaygain: don't nest functions when there's no need to
2021-03-18 22:41:13 +01:00
Benedikt
8353c831d1
Merge pull request #3889 from wisp3rwind/pr_fix_repr_deadlock
Avoid deadlocks in Item.__repr__
2021-03-18 22:39:30 +01:00
wisp3rwind
d3ec2106cd replaygain: fix write/force flags on import
This restores old behaviour.
2021-03-18 18:37:15 +01:00
wisp3rwind
0125fdf415 replaygain: don't nest functions when there's no need to 2021-03-18 18:31:00 +01:00
wisp3rwind
3d5142433f avoid deadlocks in Item.__repr__ 2021-03-18 18:05:19 +01:00
Benedikt
aa7d724aa4
Merge pull request #3886 from wisp3rwind/optimize_show_model_changes
slight performance optimization for ui.show_model_changes
2021-03-18 18:02:23 +01:00
Benedikt
0061229023
Merge pull request #3887 from wisp3rwind/fix_item_keys
when iterating over item keys, do not return duplicates
2021-03-18 18:01:34 +01:00
Benedikt
eea5c6d1f0
Merge pull request #3888 from wisp3rwind/pr_rg_cleanup
replaygain: remove debugging leftovers
2021-03-18 18:00:41 +01:00
wisp3rwind
feb5041f57 replaygain: remove debugging leftovers 2021-03-18 14:29:28 +01:00
wisp3rwind
a3a2678494 slight performance optimization for ui.show_model_changes
I didn't actually benchmark this, but creating new FormattedItemMapping
views in each iteration of the loop appeared like a rather inefficient
way of doing things. In reality, this is probably completely irrelevant,
since one would usually not show huge numbers of changed Models at a
time.
2021-03-18 12:41:59 +01:00
wisp3rwind
5183fc53ad when iterating over item keys, do not return duplicates
... for keys that exist both as Item and Album fields
2021-03-18 12:29:39 +01:00
Adrian Sampson
42d9a54ae6
Merge pull request #3885 from nicksellen/fix/no-ascii-encode
Remove ascii encode step
2021-03-17 07:58:48 -04:00
Graham Cobb
39cb013bd3
Merge pull request #3883 from GrahamCobb/bareasc
Experimental "bare-ASCII" matching query
2021-03-17 11:06:31 +00:00
Nick Sellen
6dc1f6414d
Remove ascii encoding step now library is fixed 2021-03-17 09:06:35 +00:00
Graham R. Cobb
c3485b5b04 Remove unnecessary call to format.
Signed-off-by: Graham R. Cobb <g+beets@cobb.uk.net>
2021-03-16 22:36:42 +00:00
Graham R. Cobb
b0110fa224 Try again to fix unidecode_list for python2 support
Signed-off-by: Graham R. Cobb <g+beets@cobb.uk.net>
2021-03-16 16:40:43 +00:00
Graham R. Cobb
cad2c055c5 Make unicode handling explicit, to support python 2 and 3.
Add link to Unidecode library in docs.

Signed-off-by: Graham R. Cobb <g+beets@cobb.uk.net>
2021-03-16 16:29:57 +00:00
Graham Cobb
4b9c9d0a5f
doc improvement as suggested by @sampsyo
Co-authored-by: Adrian Sampson <adrian@radbox.org>
2021-03-16 15:30:43 +00:00
Graham Cobb
2df3765521
Tidy doc as suggested by @sampsyo
Co-authored-by: Adrian Sampson <adrian@radbox.org>
2021-03-16 15:29:35 +00:00
Graham R. Cobb
0078b02085 Python2 support for bareasc command
Signed-off-by: Graham R. Cobb <g+beets@cobb.uk.net>
2021-03-16 14:50:51 +00:00
Graham R. Cobb
d1ec7b4b70 Add `bareasc` command to display entries with the unidecode transformation
applied.

Signed-off-by: Graham R. Cobb <g+beets@cobb.uk.net>
2021-03-16 11:57:52 +00:00
Graham R. Cobb
06b6b72e0e Add credit to Unidecode library into bareasc docs.
Signed-off-by: Graham R. Cobb <g+beets@cobb.uk.net>
2021-03-15 22:52:14 +00:00
Graham R. Cobb
f4fccfa05c Add documentation for bareasc to the plugins index.
Signed-off-by: Graham R. Cobb <g+beets@cobb.uk.net>
2021-03-15 15:53:14 +00:00