Commit graph

3247 commits

Author SHA1 Message Date
Ryan Lanny Jenkins
2c9f3d6464 Add check_on_import config for badfiles. 2021-03-24 16:51:58 -05: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
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
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
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
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
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
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 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
fab7a27e9f Add a couple more tests and make lint happy.
Signed-off-by: Graham R. Cobb <g+beets@cobb.uk.net>
2021-03-15 12:43:58 +00:00
Graham R. Cobb
dcbe622b76 Oops, use in for matching! (It was late last night!)
Signed-off-by: Graham R. Cobb <g+beets@cobb.uk.net>
2021-03-15 10:25:19 +00:00
Graham R. Cobb
7dd1ee3fab Remove debugging print.
Signed-off-by: Graham R. Cobb <g+beets@cobb.uk.net>
2021-03-15 01:09:50 +00:00
Graham R. Cobb
0c612f408b Create plugin for "bare-ASCII" matching query
Signed-off-by: Graham R. Cobb <g+beets@cobb.uk.net>
2021-03-15 00:55:14 +00:00
Adrian Sampson
c4347960ea
Merge pull request #3877 from GrahamCobb/web-readonly
Web readonly
2021-03-12 17:51:57 -05:00
Graham R. Cobb
4ffe9a2c45 Fixed bug where readonly value was not being read from config file.
Also simplified the setup of the `readonly` value in the tests which
fixes a test ordering issue found using --random-order.

Signed-off-by: Graham R. Cobb <g+beets@cobb.uk.net>
2021-03-12 17:58:35 +00:00
Benedikt
feb305f8fc
Merge pull request #3873 from akshgpt7/chore-refactor-issues
Refactor code quality issues
2021-03-12 01:00:43 +01:00
Graham R. Cobb
51d22b765e Add tests for delete operations
Signed-off-by: Graham R. Cobb <g+beets@cobb.uk.net>
2021-03-11 18:02:38 +00:00
Graham R. Cobb
4a9652a9e4 Only allow DELETE or PATCH operations if "readonly" is set to true.
Note: default is false which is a **NOT BACKWARDS COMPATIBLE** change.

Signed-off-by: Graham R. Cobb <g+beets@cobb.uk.net>
2021-03-11 18:02:38 +00:00
Aksh Gupta
79858975a9 chore: refactor code quality issues 2021-03-11 08:45:42 +05:30
Adrian Sampson
84f6d374c4
Merge pull request #3869 from GrahamCobb/web-regex-fix
Web regex fix
2021-03-10 20:36:03 -05:00
Graham R. Cobb
553e38fc11 Do not do backslash substitution on regex queries
As discussed in bug #3867, backslash replacement in query strings is a bit of a
hack but it is useful (see #3566 and #3567 for more discussion). However,
it breaks many regular expressions so this patch stops the replacement if the
query term contains '::', indicating it is a regex match.

This commit fixes #3867.

Signed-off-by: Graham R. Cobb <g+beets@cobb.uk.net>
2021-03-08 16:58:05 +00:00
govynnus
debd382837
Merge pull request #3758 from beetbox/aura
AURA: Add aura plugin and docs
2021-03-08 07:24:53 +00:00
Callum Brown
a24a094562 AURA: Small updates to docs and set server version 2021-03-07 18:24:57 +00:00
Callum Brown
a54ee43d57 AURA: Allow '-' character in filter attribute 2021-03-07 14:23:17 +00:00
Adrian Sampson
09a6ec4f74
Merge branch 'master' into pr/item-album-fallback 2021-03-07 09:20:50 -05:00
Callum Brown
9b9ff46e7d Merge branch 'master' into aura
Ensure aura branch has updated configuration to eliminate spurious
linter errors from the style checker.
2021-03-07 11:08:37 +00:00
Callum Brown
477eed3b25 AURA: Use py3_path rather than displayable_path
displayable_path may remove 'bad' characters, yielding a wrong path.

Also use track.path rather than track.destination() as that is where
the file is actually located rather than where it should be located
according to the beets path system.
2021-03-07 10:25:20 +00:00
Graham R. Cobb
9986b9892c Fix bug where album artpath not returned when INCLUDE_PATHS is set
Track item paths and album artpaths should be removed from results unless
INCLUDE_PATHS is set. This works for items but for albums the artpath is always
removed.

This patch makes the artpath removal conditional on INCLUDE_PATHS not being set
and includes a regression test. Note: the default value for INCLUDE_PATHS is
False so no changes will be seen by users unless they already have
INCLUDE_PATHS set.

Signed-off-by: Graham R. Cobb <g+beets@cobb.uk.net>
2021-03-06 15:25:48 +00:00
Callum Brown
2fe2f4f31e AURA: Ensure CORS allowed origins are strings 2021-03-06 13:30:31 +00:00
Callum Brown
fbc76887ad AURA: Fix styling when formatting error strings 2021-03-06 13:22:28 +00:00
Callum Brown
07cfaaa3b3 AURA: Simplify if statements
Get rid of ` is not None`
Change `len(x) == 0` to `not x`
Change `x is None` to `not x`
2021-03-06 12:44:32 +00:00
Callum Brown
b1baeb37f1 AURA: replace translate_attribute with a dict.get 2021-03-06 12:08:35 +00:00
Callum Brown
7e819d2a2e AURA: Update artist-mbid attribute to use '-' 2021-03-06 12:01:02 +00:00
George Rawlinson
00252ab28f
Fix #3608: Replace discogs-client with python3-discogs-client
discogs-client has been deprecated since June 2020, the replacement
is actively developed by the community and does not have any breaking
API changes.

Signed-off-by: George Rawlinson <george@rawlinson.net.nz>
2021-02-27 10:09:23 +13:00
Andrea Mistrali
1a65501cee Clean up strip_path and logging 2021-02-23 10:40:59 +01:00
Andrea Mistrali
48e7d2964e Style changes 2021-02-23 05:45:53 +01:00
Andrea Mistrali
0e67b6801c ARGH! Wrong variable 2021-02-22 14:50:30 +01:00
Andrea Mistrali
921bc424cd Better handling of strip_path 2021-02-22 14:47:58 +01:00
Andrea Mistrali
99de85b5c2 Only leftmost subpath is replaced 2021-02-22 14:33:01 +01:00
Andrea Mistrali
ce974d4fc7 One line :) 2021-02-22 14:30:50 +01:00
Andrea Mistrali
414b682123 Add strip_path to mpdstats 2021-02-22 11:19:23 +01:00
Samuel Cook
ff4cec2e69
Removes support for bs1770gain.
References in the documentation to this plugin were removed in
beetbox/beets#3127 (beetbox/beets#3130) but no actual code
changes were made.

This PR removes support for this dependency entirely.
2021-01-27 17:42:18 -08:00
John Hamelink
77ce69fe77
Fixes #3834:
This PR fixes a bug (#3834) where tracks which have already been fingerprinted do not return to be used by `beet submit` (part of the Chroma plugin). This results in  submission errors, as the fingerprint is omitted from the resultant payload sent to acoustID.
2021-01-19 22:05:34 +00:00
wisp3rwind
02ec2cfd57 style: whitespace fix, remove unnecessary parenthesis 2021-01-19 19:09:30 +01:00
Benedikt
6680f692f6
Merge pull request #3832 from vincentDcmps/master
Automatically choose subsonic authentication algorithm based on server version
2021-01-19 19:00:10 +01:00
Martin Haaß
9587caf916
convert: uses new par_map to work in parallel (#3830)
Squashed 5 commits:
* convert: uses new par_map to work in parallel
* linting
* code review: remove unneeded list syntax
* linting
* changelog addition
2021-01-19 18:47:02 +01:00
vincent
8af088c785 manage case of supysonic off 2021-01-18 18:24:25 +01:00
vincent
9b496e5027 change comparaison version method 2021-01-13 17:50:37 +01:00
Vincent Ducamps
03a665861d reformating subsonicupdate.py
Co-authored-by: Jef LeCompte <jeffreylec@gmail.com>
2021-01-12 18:31:43 +01:00
Vincent Ducamps
b37c55bc0b pass get_version to private
Co-authored-by: Jef LeCompte <jeffreylec@gmail.com>
2021-01-11 21:19:52 +01:00
vincent
375c158fc7 implement version check 2021-01-11 18:29:27 +01:00
vincent
54748ad4c9 change auth option enc by password 2021-01-11 17:56:09 +01:00
vincent
93bb114175 update doc 2021-01-11 17:55:23 +01:00
vincent
c1cc91c5e9 add old password option 2021-01-10 12:30:05 +01:00
vincent
0d5ad875d4 add .view to endpoint 2021-01-10 12:19:43 +01:00
FichteFoll
5ace2b626b
Merge remote-tracking branch 'upstream/master' into pr/item-album-fallback 2021-01-08 18:47:18 +01:00
Andrew Simmons
73a7723a15 Add python version check 2021-01-06 10:33:50 -05:00
Auguste Olivry
34c38f41bd Cosmetic fix 2021-01-05 16:15:50 +01:00
Auguste Olivry
345cf6e39b Move index handling inside coalesce_tracks 2021-01-05 16:14:36 +01:00
Auguste Olivry
c61d18bed3 Remove semicolon when prefix is empty 2021-01-05 14:15:22 +01:00
Auguste Olivry
8bda9f991a Keep index tracks in coalesced tracklist 2021-01-05 14:15:22 +01:00
Adrian Sampson
53dcb24d10
Merge pull request #3671 from dosoe/beets_test_parentwork
first try at mocking get_work_by_id
2020-12-22 12:01:17 -05:00
ybnd
eb8ba838e5 Check 'auto' on import_begin 2020-12-22 12:45:28 +01:00
ybnd
93101e7ea6 Disable replaygain parallelism during import 2020-12-21 19:19:20 +01:00
ybnd
12db40fa67 Remove .get() when checking config values 2020-12-21 08:50:39 +01:00
ybnd
1dfd79e658 Fix logic for replaygain auto-compute on import 2020-12-20 19:38:21 +01:00
Adrian Sampson
48222153ae
Merge pull request #3812 from billyjanitsch/fix-fish-completions
Fix escape helper in fish completion plugin
2020-12-16 08:10:48 -05:00
Billy Janitsch
c94809f6da Fix escape helper in fish completion plugin 2020-12-16 02:15:26 -05:00
sentriz
95677c8626
lastgenre: Make TitleCasing optional 2020-12-15 23:37:16 +00:00
ybnd
e3205aacbd Merge remote-tracking branch 'origin/master' into parallel-replaygain 2020-12-14 22:19:28 +01:00
ybnd
363f71af2e Move OperationalError handler to test_replaygain.py 2020-12-14 22:10:54 +01:00
Adam Miller
c1d93165f0 Fix line length 2020-12-07 22:11:08 -05:00
Adam Miller
e11687f80a keyfinder: Catch output from keyfinder-cli with no key 2020-12-07 22:04:05 -05:00
Benedikt Tissot
020c082f3f make CI happy 2020-11-09 17:12:44 +01:00
Benedikt Tissot
57a1b3aca8 escape using helper function 2020-11-09 17:07:00 +01:00
Benedikt Tissot
8f8fd4231a escape ? in fish completion 2020-11-09 15:55:21 +01:00
AnonTester
ecfafb5041 Adjust comment to pass lint test 2020-11-07 21:48:21 +00:00
AnonTester
176fa55bf6 lyrics: Strip \u2005 (four-per-em space) in lyrics (Issue 3789)
https://github.com/beetbox/beets/issues/3789
2020-11-07 21:41:16 +00:00
FichteFoll
701cd6c42b
Merge remote-tracking branch 'upstream/master' into pr/item-album-fallback 2020-11-02 00:10:46 +01:00
Callum Brown
e067298224 Add default config values in create_app()
So if not run through beet aura then default values will be available
2020-10-28 18:56:45 +00:00
Jack Wilsdon
580495f1d6
Simplify MusiXmatch backend and remove unused code 2020-10-05 22:56:01 +01:00
Jack Wilsdon
d115f3679b
Remove LyricWiki source
LyricWiki was shut down on 2020/09/21 and no longer serves lyrics.
2020-10-05 22:15:40 +01:00
Sam Thursfield
d9582f4bea export: Add --format=jsonlines option
This adds support for the JSON Lines format as documented at
https://jsonlines.org/.

In this mode the data is output incrementally, whereas the other
modes load every item into memory and don't produce output until
the end.
2020-10-02 12:41:29 +02:00
Callum Brown
e8aa96ef72 AURA: Add argument info to docstrings
Follows the google docstring style:
https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings
2020-09-27 18:58:39 +01:00
Callum Brown
51c3f310e9 AURA: Fix docstrings for tox -e lint 2020-09-27 18:09:16 +01:00
Callum Brown
5c875c50de AURA: Add aura plugin and docs 2020-09-21 20:24:41 +01:00
Cadel Watson
d1f93a26a6 Fix lint errors 2020-09-20 11:30:12 +10:00
Cadel Watson
a18b317240 Add PATCH method to item queries 2020-09-20 10:46:48 +10:00
Cadel Watson
afcde697e0 Add PATCH method to Items 2020-09-20 10:45:12 +10:00
Cadel Watson
29672a434f Add DELETE method to resource queries 2020-09-20 10:23:25 +10:00