Commit graph

10167 commits

Author SHA1 Message Date
Andrew Rogl
b59da2e4f5 Changelog entry 2021-05-08 16:10:19 +10:00
Andrew Rogl
cff4ed59bf Update documentation 2021-05-08 15:33:58 +10:00
Andrew Rogl
9ce93faa22 Flake8 setup.py 2021-05-07 22:33:11 +10:00
Andrew Rogl
45e63e6838 fix up setup 2021-05-07 22:30:14 +10:00
Andrew Rogl
533559136e Add 7z file support #3906 2021-05-07 22:04:46 +10:00
Bert Besser
e10b2754c3 optimize set_fields loop 2021-05-07 07:11:41 +02:00
Bert Besser
9cbbc35a95 persist set_fields to media files 2021-05-06 19:55:12 +02:00
Adrian Sampson
2cff7e8229
Merge pull request #3923 from jellekaufmann/master
Add HTTPS support/configuration option for Musicbrainz
2021-05-04 12:00:01 -04:00
Jelle Kaufmann
2eae5a8ecc
Update docs/changelog.rst
Co-authored-by: Adrian Sampson <adrian@radbox.org>
2021-05-04 17:01:52 +02:00
Jelle Kaufmann
5460a81a4e
Update docs/reference/config.rst
Co-authored-by: Adrian Sampson <adrian@radbox.org>
2021-05-04 17:01:25 +02:00
Jelle Kaufmann
449617050d Change behavior to HTTPS by default for musicbrainz.org, but HTTP by default for custom servers 2021-05-04 16:07:08 +02:00
Jelle Kaufmann
a46c975387 Add HTTPS support for Musicbrainz 2021-05-03 20:28:47 +02:00
Sam Thursfield
7254611a38
Merge pull request #3762 from beetbox/sam/export-speed
Optimise FormattedMapping when querying a specific set of fields
2021-05-03 15:10:07 +02:00
Andrew Rogl
923e3bacd6 Attempt to fix duplicates #2873 2021-05-03 16:03:40 +10:00
Sam Thursfield
2fa3717731 Optimise FormattedMapping when querying a specific set of fields
This changes greatly improves the speed of `beet export` and `beet info`
when the `--include-keys` option is used. It also removes the globbing
feature of `--include-keys` that was added in #1295. (See #3762 for
discussion).

Listing all fields for an item requires querying the database to find
any flex attributes. This is slow when done for every item being
exported. We already have a way for the user to specify a fixed set
of keys, but we previously queried everything and filtered it afterwards.
The new approach is more efficient.

Code that iterates through all fields now have to handle invalid field
names. The export and info plugins output invalid fields as None.

Timings before:

    > /usr/bin/time beet export -i title,path,artist -l  Bob Dylan
    13.26user 20.22system 0:34.01elapsed 98%CPU (0avgtext+0avgdata 52544maxresident)k

    > /usr/bin/time beet export -l  Bob Dylan
    12.93user 20.15system 0:33.58elapsed 98%CPU (0avgtext+0avgdata 53632maxresident)k

Timings after:

    > /usr/bin/time beet export -l  Bob Dylan
    13.33user 20.17system 0:34.02elapsed 98%CPU (0avgtext+0avgdata 53500maxresident)k

    > /usr/bin/time beet export -i title,path,artist -l  Bob Dylan
    0.49user 0.07system 0:00.56elapsed 98%CPU (0avgtext+0avgdata 50496maxresident)k

Notice the dramatic speedup in the last example!
2021-05-01 23:41:09 +02:00
Jef LeCompte
e1a901dce5
chore: makes discussions more visible (#3807) 2021-04-19 19:37:00 -04:00
Jef LeCompte
50163b373f
ci: scope ci workflow (#3907) 2021-04-17 09:51:03 -04:00
Adrian Sampson
63ec2bf31e
Merge pull request #3905 from xhocquet/tekstowo-fix
Fix falso positive lyric pages for Tekstowo
2021-04-11 20:33:19 -04:00
Xavier Hocquet
8b979f2a50 Review comments 2021-04-11 18:38:01 -05:00
Xavier Hocquet
0dd569a884 Add changelog 2021-04-11 17:34:46 -05:00
Xavier Hocquet
31f4df3ff3 Fix falso positive lyric pages for Tekstowo 2021-04-11 17:30:45 -05:00
Adrian Sampson
2fa2d1b4ee
Merge pull request #3901 from Ubiquitine/patch-1
Fix for Musixmatch multi-part lyrics
2021-04-07 08:33:40 -04:00
Evgeniy Gurevich
802af4203b
Update changelog.rst 2021-04-07 20:12:52 +08:00
Evgeniy Gurevich
afc072801c
Simplify Musixmatch multi-part lyrics parser 2021-04-02 10:35:53 +08:00
Evgeniy Gurevich
a8fe8ce9a7
Fix for Musixmatch multi-part lyrics
Sometimes Musixmatch lyrics come in 2 parts.
Also, sometime non-existent lyrics return some content
2021-04-01 14:21:49 +08:00
Adrian Sampson
eab4372a58
Merge pull request #3900 from Lanny/master
badfiles: Optionally run checkers during import
2021-03-29 19:28:30 -04:00
Ryan Lanny Jenkins
c8fa1b2809 Raise PluginConflictException instead of the generic Exception for new hook. 2021-03-29 18:12:30 -05:00
Ryan Lanny Jenkins
79616b42ed Use simpler approach of asserting that at most one handler of import_task_before_choice returns an action. 2021-03-28 16:53:01 -05:00
Adrian Sampson
f067180c4c
Shorten a ReST underline 2021-03-28 14:23:38 -04:00
Adrian Sampson
1ead968a27
Merge pull request #3519 from xhocquet/tekstowo-lyrics
Implement tekstowo lyrics provider
2021-03-28 14:23:23 -04:00
Xavier Hocquet
6081e6a8df CR comments 2021-03-28 13:08:00 -05:00
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