Commit graph

4193 commits

Author SHA1 Message Date
Alok Saboo
b69de85d49 Add 429 and 503 error handling 2023-10-10 15:20:29 -04:00
Alok Saboo
989ee5a69c Remove retry logic 2023-10-10 14:49:50 -04:00
Alok Saboo
d87e3e6628 Update error code 2023-10-09 08:59:15 -04:00
Alok Saboo
e68369bc8a Change retry logic 2023-10-07 18:59:02 -04:00
Alok Saboo
97ad4baee4 Update spotify.py 2023-10-07 18:30:03 -04:00
Alok Saboo
d09af885ed Change the log to error 2023-10-07 18:23:16 -04:00
Alok Saboo
36a92381e7 add a default timeout of 30 seconds 2023-10-07 18:22:39 -04:00
Alok Saboo
337e5f4548 gracefully handle Spotify timeout error 2023-10-07 18:19:58 -04:00
AdrienCos
96b89e77f6 Fix the error with CAA where no image would be downloaded when thumbnails are missing 2023-10-07 23:14:03 +02:00
AdrienCos
e7105a9763 Fix the error with CAA where the pre-sized thumbs of release groups would be ignored 2023-10-07 21:25:02 +02:00
Adrian Sampson
b822fe0f5c
Merge pull request #4923 from tandy-1000/autobpm
Add autobpm plugin
2023-10-02 15:56:23 -04:00
tandy1000
7961cf3aaa Add autobpm plugin
This plugin uses librosa to automatically calculate the BPM for a track.
It is based on the keyfinder plugin, and rounds the BPM to an int.

Co-authored-by: Adrian Sampson <adrian@radbox.org>
2023-09-30 16:25:06 +01:00
Kian-Meng Ang
873a91c541 Fix typos
Found via `codespell -S ./test/rsrc,genres.txt -L
caf,fo,ue,searchin,crashers,crasher,te,skool,egal,nothin`
2023-09-25 12:52:26 +08:00
Adrian Sampson
c15ccb16bf
Merge pull request #4900 from fracai/4326-scrub-no-rewrite
4326 scrub should not restore on import if "write" is disabled
2023-09-16 12:47:07 -04:00
Arno Hautala
d8eba458bd use ui.should_write() to control restore during import 2023-09-06 18:50:01 -04:00
J0J0 Todos
4f4e4cdc70 Fix docstring issues in substitute module
to finally make linter happy.
2023-08-31 09:26:42 +02:00
Daniele Ferone
f3f6118b8f Linting fixes in substitute plugin 2023-08-31 08:04:24 +02:00
Daniele Ferone
a4363fb680 Fixes in substitute plugin docs 2023-08-31 08:04:10 +02:00
Daniele Ferone
07c33756b7 _substitute_rules became a class field 2023-08-31 07:08:10 +02:00
Daniele Ferone
249b420b19 Added plugin 2023-08-31 07:07:09 +02:00
Sam Caldwell
b7e3d37c1b feat[embyupdate]: add handling for private users
Adds a `userid` config option for the `embyupdate` plugin. When the
`userid` is provided, the Emby user lookup is bypassed. This avoids a
failure to get the user ID for private users.

Closes: #4402
2023-08-24 18:50:29 -07:00
J0J0 Todos
8d835b8cab Fix ipfs plugin and test_ipfs
by using store(inherit=False) for the creation of a new "ipfs album" as well as
when test_ipfs creates album+items to compare with.
Or put differently: Make ipfs and test_ipfs keep the old store() behaviour for
which the plugin initially was built for.
2023-08-23 06:34:16 +02:00
Adrian Sampson
49846e7851
lyrics: Bypass None values in Google backend
Fixes #4875.
2023-08-13 18:52:39 -04:00
luzpaz
8419149c7a
Fix various typos 2023-08-09 21:26:15 -04:00
Adrian Sampson
7f7db33cf8
Adapt to some recent flake8/pycodestyle changes
As surfaced in this CI run:
https://github.com/beetbox/beets/actions/runs/5716141601/job/15486984755?pr=4866

These all look like perfectly reasonable improvements that are unlikely
to break anything.
2023-07-31 10:00:41 -07:00
J0J0 Todos
342421a36c
Update beetsplug/importfeeds.py
Co-authored-by: Adrian Sampson <adrian@radbox.org>
2023-07-27 20:14:39 +02:00
J0J0 Todos
60227c48f5 Add m3u per session feature to importfeeds plugin 2023-07-27 07:56:14 +02:00
J0J0 Todos
e9f840580a Trigger subsonicupdate on db_change and splupdate
- Trigger subsonicupdate on database_change event instead of only at import
  event.
- Send a new event from smartplaylist plugin whenever lists are updated/created
  and have subsonicupdate plugin listen to it.
- Make sure the both events register a new listener that launches the actual
  subsonic library update at the very end of a beets run (cli_exit) instead of
  during each change (similar to how mpdupdate plugin does it).
2023-07-27 07:41:50 +02:00
J0J0 Todos
871be9c98b Log smartplaylist create msg as info log
instead of debug log. In an explicit run (not while importing) it doesn't hurt
to get some progress to the UI.
2023-07-25 07:52:51 +02:00
J0J0 Todos
c03bd26e3a
Merge pull request #4854 from JOJ0/discogs_single_album_refactor
Support providing album information on singleton imports via Discogs
2023-07-25 06:23:27 +02:00
wisp3rwind
3965858ac1 replaygain: apply review feedback: fixup previous refactor, improve tests
by adding files which are not completely silent, thus hitting a different
code path in some calculations

The sample files were generated using
> sox -n whitenoise.flac synth 00:00:02 whitenoise
> ffmpeg -i whitenoise.flac whitenoise.opus
> ffmpeg -i whitenoise.flac whitenoise.mp3
2023-07-22 12:47:19 +02:00
wisp3rwind
b8be2af11d replaygain: in Gst backend, pass paths instead of items around
This is a preparation for moving the Gst calculation to multiprocessing
worker threads. Passing only the file paths to the worker threads instead of
synchronizing the entire `Item`s (i.e. minimizing the data that is
shared between the processes) hopefully helps to prevent any issues with
this approach.
2023-07-22 12:47:19 +02:00
wisp3rwind
fa37085493 replaygain: in ffmpeg backend refactor album gain calculation
now that we have the `track_results` upfront, some simplifications are
possible
2023-07-22 12:47:19 +02:00
wisp3rwind
76f6c86291 replaygain: in ffmpeg backend, analyse items upfront, then summarize...
...album gains. This is in preparation for parallelizing the track
analysis, and computing the album values in the plugin's "main thread"
once all items are done.
2023-07-22 12:47:19 +02:00
wisp3rwind
545ed6f385 replaygain: log album name for album tasks
doesn't seem to be very useful to log the _list of items_ here
2023-07-22 12:47:19 +02:00
wisp3rwind
7ec7a0d362 replaygain: avoid hasattr in favor of None values
to check for an optional ThreadPool. Seems more idiomatic and readable.
2023-07-22 12:47:19 +02:00
J0J0 Todos
f84b9ea7cf DiscogsPlugin.item_candidates attaches album info
to the TrackInfo objects it returns.

Additionally a new feature is introduced that uses string_dist to find the
correct track on the Discogs album.
2023-07-20 09:12:42 +02:00
J0J0 Todos
0630f4a263 Strip word "vinyl" when searching Discogs
In DiscogsPlugin.get_albums() we already strip away the words "CD" and "disk".
It makes sense to also remove "vinyl"
2023-07-18 08:05:22 +02:00
J0J0 Todos
3debf4edca Fix early exit in Discogs item_candidates method 2023-07-18 07:51:12 +02:00
wisp3rwind
29c21860a9 add missing syspath conversions (2/3, beetsplug) 2023-07-16 10:17:40 +02:00
Alok Saboo
ef8a780e1c Add error handling for invalid Deezer track_id 2023-07-13 09:53:41 -04:00
Alok Saboo
63122da24d remove unused imports 2023-07-10 15:55:42 -04:00
Alok Saboo
c00cdd3cc7 Error handling 2023-07-10 15:52:36 -04:00
Alok Saboo
acd604f102 Update deezer.py 2023-07-10 15:39:28 -04:00
Alok Saboo
a027612216 error handling 2023-07-10 15:34:06 -04:00
Alok Saboo
014d41f208 Error handling 2023-07-10 15:30:20 -04:00
Alok Saboo
6460e4d829 added deezer_updated to keep track of update time 2023-07-09 19:06:04 -04:00
Alok Saboo
a291ec3f0b convert urs to f-string format 2023-07-09 18:43:35 -04:00
Alok Saboo
783ea2a444 Add function to update Deezer rank 2023-07-09 18:39:15 -04:00
Alok Saboo
cdfebdba8e Update deezer.py 2023-07-09 18:02:11 -04:00
Alok Saboo
5419a78bd2 Added additional fields to be imported from Deezer 2023-07-09 17:59:50 -04:00
wisp3rwind
a84b3542f9 typing: corrections for dbcore/types.py
tricky...
- the only way I found to express the concept of the "associated type"
  (in Rust lingo) model_type was by making Type generic over its value
  and null types.
- in addition, the class hierarchy of Integer and Float types had to be
  modified, since previously some of them would have conflicting null
  types relative to their super class (this required a change to the
  edit plugin; hopefully no more breakage is caused by these changes)
- don't import the query module, but only the relevant Query's to avoid
  confusing the module query and the class variable query
2023-06-24 11:51:00 +02:00
wisp3rwind
bc7c447b3c beetsplug/playlist: actually use SQL clause
As far as I can tell, the fast SQL path was never used before, since a
query would use the default `clause()` implementation. It is only the
`FieldQuery.clause()` that could delegate to `col_clause()`, but
`PlaylistQuery` is not a `FieldQuery`.
2023-06-23 11:00:09 +02:00
wisp3rwind
09d2c87f29 typings: corrections for dbcore/queryparse
- Add NamedQuery abstract class to be able to express the expectation
  that a query should be such a query (and have a specific constructor
  signature) in construct_query_part
- slightly (and probably completely irrelevantly) improve Query.__hash__
- also, sprinkle some ABC/abstractmethod around to clarify things
2023-06-23 10:59:51 +02:00
J0J0 Todos
0d8f8a3cff Fix ValueError in convert plugin auto_convert_keep 2023-06-22 09:13:09 +02:00
lonebyte
2c3aca23e1
Fix the sorting of fanart.tv covers
fanart.tv uses a string to output the number of likes (see https://fanart.tv/api-docs/api-v3/). In order to sort numerically we need to convert the string into an int.
2023-06-14 20:25:18 +02:00
Alok Saboo
7a9d8f9752 added error handling 2023-05-26 08:40:15 -04:00
Alok Saboo
0f1add8b02 Change to spotify_album_id 2023-05-26 08:31:51 -04:00
Alok Saboo
fa822d6ab2 Add a check for valid data 2023-05-25 13:55:57 -04:00
Alok Saboo
c0e3a530f7 Update spotify.py 2023-05-25 13:41:09 -04:00
Alok Saboo
652877617a Change preposition 2023-05-11 20:17:23 -04:00
Alok Saboo
e4c669adcd Address review comments. 2023-05-11 20:12:32 -04:00
Alok Saboo
16e6a2d490 Merge remote-tracking branch 'upstream/master' into coverarturl 2023-05-07 14:29:04 -04:00
wisp3rwind
f5b20114b4 fetchart: revert a cleanup from 4774 that could break plugins
cf. @arogl's comment 254bb297c8 (commitcomment-111922347)

> Now that this has been merged, external plugins that add to the fetchart plugin now fail with:
>
> ```AttributeError: module 'beetsplug.fetchart' has no attribute 'SOURCES_ALL'``
2023-05-05 20:36:28 +02:00
Alok Saboo
f06c5ed593 Update debug logs 2023-05-02 09:51:45 -04:00
Alok Saboo
27a50ce364 Remove unrelated commits 2023-05-02 09:39:59 -04:00
Alok Saboo
1c21821f4a Added changelog and additional error handling 2023-05-02 08:22:54 -04:00
Alok Saboo
17d1a431bc Merge remote-tracking branch 'upstream/master' into coverarturl 2023-05-02 08:08:17 -04:00
Alok Saboo
45f4ce6f9a Add additional checks to prevent Spotify calls 2023-05-02 08:01:41 -04:00
Alok Saboo
4349c1e489 Update fetchart.py 2023-04-30 08:54:51 -04:00
Alok Saboo
2dc784d3a8 Merge remote-tracking branch 'upstream/master' into coverarturl 2023-04-30 08:51:17 -04:00
wisp3rwind
d236747587 fetchart: add add_default_config() method to sources
in order to move the remaining source-specific code out of plugin
initialization and into the source classes
2023-04-30 10:15:40 +02:00
wisp3rwind
254bb297c8 fetchart: add available() method to sources
in order to move (some of) the source-specific code out of plugin
initialization and into the source classes
2023-04-30 10:04:54 +02:00
Alok Saboo
9944599639 Update fetchart.py 2023-04-29 16:44:20 -04:00
Alok Saboo
456cfd7dae Update fetchart.py 2023-04-29 16:40:10 -04:00
Alok Saboo
2f0d416965 Cleanup 2023-04-29 13:41:51 -04:00
Alok Saboo
7dd9137f92 Update fetchart.py 2023-04-29 13:31:18 -04:00
Alok Saboo
17591c3ffd Update fetchart.py 2023-04-29 13:30:50 -04:00
Alok Saboo
5cdd9b5747 Add to sources_all 2023-04-29 13:27:40 -04:00
Alok Saboo
17d2193c02 Add cover_art_url as fetchart source 2023-04-29 13:19:59 -04:00
Alok Saboo
44751b020e Merge remote-tracking branch 'upstream/master' into spotify_fetch 2023-04-29 08:45:15 -04:00
wisp3rwind
4ae1e8278c web: fix for breaking werkzeug change
cf. https://github.com/pallets/werkzeug/issues/2506

didn't check when part_isolating was introduced, but presumably, it
should be harmless to set this attribute for old werkzeug versions that
didn't have it yet
2023-04-29 11:37:46 +02:00
Alok Saboo
d4eb3a6b82 Update fetchart.py 2023-04-28 18:05:27 -04:00
Alok Saboo
067a3633d3 Change error handling 2023-04-28 18:02:17 -04:00
Alok Saboo
34fe9344ae change preposition 2023-04-28 08:50:01 -04:00
Alok Saboo
654b57f50a Make beautifulsoup optional 2023-04-28 08:47:32 -04:00
Alok Saboo
036667c51e change variable to lower case 2023-04-27 18:13:39 -04:00
Alok Saboo
18bcadcfdc Add spotify art source 2023-04-27 18:10:09 -04:00
Alok Saboo
bb2ce02e07 Remove logging 2023-04-18 20:54:43 -04:00
Alok Saboo
0492f1f214 Address comments 2023-04-14 08:10:13 -04:00
Alok Saboo
1e3fee8495 Use temp folder instead of cwd 2023-04-14 08:08:59 -04:00
Alok Saboo
023f3d7df7 Merge remote-tracking branch 'upstream/master' into embedart_url 2023-04-09 15:11:21 -04:00
Alok Saboo
3a1e4bd845 Remove temporary logging 2023-04-09 14:07:55 -04:00
Alok Saboo
8357617f02 Change indentation 2023-04-09 14:02:10 -04:00
Alok Saboo
34a4e7be5f Move away from PIL and use mimetypes instead 2023-04-09 13:58:26 -04:00
Šarūnas Nejus
b5b1afbfff
Also perform bareasc queries in SQL 2023-04-09 18:43:33 +01:00
Alok Saboo
99ca3e96d4 Add more error handling for the img.save function 2023-04-09 09:58:31 -04:00
Alok Saboo
9c3f4a4ac8 Change image format to PNG 2023-04-08 22:03:59 -04:00
Alok Saboo
b3008b74b8 Remove unused imports 2023-04-08 21:12:23 -04:00
Alok Saboo
23b42e80e2 Merge remote-tracking branch 'upstream/master' into embedart_url 2023-04-08 21:07:41 -04:00
Alok Saboo
93f4068cca Address review comments 2023-04-08 21:01:10 -04:00
J0J0 Todos
86929eb6a0 convert: playlist: Adapt code comments
- Remove initial comment around playlist entry condition (which is better
  suited for user docs anyway, and stated there already)
- Add explanation above the items_paths playlist contents creation list
  comprehension.
2023-04-02 19:34:13 +02:00
J0J0 Todos
16e361baf3 convert: playlist: item_paths relative to playlist
Ensure entries in items_paths are generated with a path relative to the
location of the playlist file.
2023-04-02 13:10:14 +02:00
J0J0 Todos
a4d03ef586 convert: playlist: M3U write + contents as bytes
Make sure we stay with the beets standard of handling everything internally as
bytes.

- M3UFile.write() method writes in wb mode.
- Playlist contents and EXTM3U header is handled as bytes.
  - item.destination() gives us unicode string paths, we tranlate to bytes
    using util.bytestring_path().
- Fix test_playlist*write* tests to encode UTF-8 assert strings as bytes using
  bytestring_path() before comparision.
2023-03-29 07:46:08 +02:00
J0J0 Todos
20a0012f79 convert: playlist: Use normpath for playlist file
Fixes FileNotFoundError when for example a tilde (~) characteris used for a
--dest path.
2023-03-29 07:46:08 +02:00
J0J0 T
d248063f96 convert: playlist: Improve --playlist help text 2023-03-29 07:46:08 +02:00
J0J0 T
cb630c45f6 convert: playlist: Also use syspath() for contents
of playlist. We want to have processed every entry in the media list we
pass to the M3UFile instance.
2023-03-29 07:46:08 +02:00
J0J0 T
7d121c390b convert: playlist: Move M3UFile class to separate
module in util package.
2023-03-29 07:46:08 +02:00
J0J0 T
55b386375a convert: playlist: Move m3u creation after conversions
- Move the creation of the playlist file to the very end, right after
  self._parallel_convert, in the convert plugin's main function.
- In the test code, the destination directory is created when the
  conversion happens, thus this fixes test_playlist and doesn't hurt the
  feature - The playlist creation can as well be the very last step in
  the process.
2023-03-29 07:21:27 +02:00
J0J0 T
5dfff50005 convert: playlist: Refactor m3u writing to class
and also implement a currently untested load() method.
2023-03-29 07:21:27 +02:00
J0J0 T
c251ed19c4 convert: playlist: Generate m3u file in one batch
to avoid any possible interference with the threaded file conversion
mechanism.
2023-03-29 07:21:27 +02:00
J0J0 T
d589e77ade convert: playlist: Fix redundant join path
It's done in _get_opts_and_config already.
2023-03-29 07:21:27 +02:00
J0J0 T
c0b1bc9867 convert: playlist feature: Better relative path gen
Use Item.destination method for generation of relative paths to media
files in playlist. The fragment keyword enables returning the path as
unicode instead of bytes, let's keep that in mind.
2023-03-29 07:21:27 +02:00
J0J0 T
16e25bb61b convert: playlist feature: Fix relative paths
pointing to media files in playlist. Also refine code comment and move
to a better fitting place.
2023-03-29 07:21:27 +02:00
J0J0 T
fd8fe69738 convert: Playlist feature linting fixes 2023-03-29 07:21:27 +02:00
J0J0 T
d448e0c4de convert: Refine and fix playlist feature
- Improve --help text
- Use unicode instead of bytes when adding media file paths to the
  playlist file.
- The "standard" (?) of m3u8 defines that unicode should ensure support
  of special characters in media file names. util.displayable_path() is
  used to do the conversion from bytes. We save everything in bytes in
  the config since it seemes to be the way this plugin or beets in
  general likes to save paths.
- Join dest and playlist in the config reader method already to have it
  ready in both methods that require the full path to the playlist file.
2023-03-29 07:21:27 +02:00
J0J0 T
861bc69df5 convert: Add a quick & dirty m3u playlist feature 2023-03-29 07:21:27 +02:00
Alok Saboo
3b39a4fe66 Raise OSError 2023-03-28 13:23:26 -04:00
Alok Saboo
2fcdb8c2ca Add FilesystemError handling 2023-03-28 09:22:51 -04:00
Alok Saboo
a4b4df8b12 More error handling 2023-03-27 19:28:09 -04:00
Alok Saboo
2e2a3bf223 Add additional error handling 2023-03-27 11:56:26 -04:00
J0J0 Todos
5bf4e3d92f Dedicated flex attrs for Deezer, Beatport album ID
- Similar to what the Spotify plugin does, on imports we save to a field
  `..._album_id` (spotify_album_id, deezer_album_id, beatport_album_id)
- It would be good to submit such a change to the 3rd-party plugins beetcamp
  and beatport4 as well (beatport_album_id, bandcamp_album_id).
- We might need to investigate why none of these
  flex attr fields get populated to the beets album level (`beet info -a`,
  album_attributes db table), it is only available at the item level (`beet
  info`, item_attributes db table). This should be tackled in a future
  issue/PR.
2023-03-26 13:20:07 +02:00
Alok Saboo
2060e047d2 Update parser options 2023-03-19 10:21:32 -04:00
Alok Saboo
2d942ce722 Move import inside the function 2023-03-19 09:15:38 -04:00
Alok Saboo
59d5d23bb3 Update embedart.py 2023-03-18 19:12:29 -04:00
Alok Saboo
64c2ae138d Update embedart.py 2023-03-18 19:11:24 -04:00
Alok Saboo
81835b0721 Update embedart.py 2023-03-18 19:08:46 -04:00
Alok Saboo
4dd165495f Update embedart.py 2023-03-18 19:00:28 -04:00
Alok Saboo
feeeb4080c Update embedart.py 2023-03-18 18:58:32 -04:00
Alok Saboo
f051d67947 Add option to import using URL 2023-03-18 18:23:53 -04:00
Adrian Sampson
2e18f84b38
Merge pull request #4698 from ghbrown/discogs_client_check
discogs_client version check
2023-03-10 21:56:48 -08:00
ghbrown
f1b7832d52 Change minimum discogs_client version to 2.3.15 2023-03-10 15:28:29 -06:00
Andrew Rogl
e33369d231
Fix typo in beetsplug/deezer.py
Found another typo
2023-03-10 17:28:52 +10:00
ghbrown
bad541e2c4 Address lint errors for discogs_client version check 2023-03-09 17:38:47 -06:00
ghbrown
437f6e76e4 Add warning about (python3-)discogs-client version 2023-03-09 17:16:11 -06:00
Andrew Rogl
5662fef842
Fix type in deezer.py 2023-03-09 17:05:03 +10:00
J0J0 Todos
f36c55f730 Refactor Beatport plugin to use _get_id
from MetadataSourcePlugin and save beatport_id_regex in id_extractors module.
This streamlines the Beatport release ID extraction magic with plugins Deezer
and Spotify.
2023-03-08 18:12:31 +01:00
J0J0 Todos
8ab25694a5 Move Deezer ID regex to id_extractors module
in beets.util package.
2023-03-08 18:12:31 +01:00
J0J0 Todos
284180ec75 Refactor MetadataSourcePlugin._get_id()
and put to use in Spotify plugin.

- Make _get_id() a staticmethod usable from outside a metadata source plugin.
- id_regex now has to be passed as an argument instead of assuming it is
  accessible via an instance variable (self.id_regex).
- In the Spotify plugin, import spotify_id_regex from util.id_extractors
2023-03-08 18:12:31 +01:00
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
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
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
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
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
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
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
wisp3rwind
12173d30a8 permissions: Move syspath conversion to the actual API boundary 2023-02-12 14:04: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
527052e13d
Merge branch 'master' into splupdate_dry_run 2023-01-31 07:07:09 +01:00
ghbrown
a99eb77337 Improve where an how data added to tracks of album 2023-01-20 22:15:50 -06:00
ghbrown
cbb1b21408 Use tracks field in item_candidates; add more info to tracks of AlbumInfo 2023-01-20 21:07:15 -06:00
ghbrown
2df41b9e16 Limit number of returned track candidates 2023-01-16 18:43:26 -06:00
ghbrown
2e916404f9 early exit; add data_source 2023-01-12 19:41:04 -06:00
ghbrown
2db0796fad Implement item_candidates for Discogs 2023-01-11 13:20:54 -06:00
Adrian Sampson
6989bce6ca
Merge pull request #4515 from JOJ0/fix_discogs_multi_artist
Handle "join keyword" in `MetadataSourcePlugin.get_artist()`
2023-01-06 10:30:23 -08:00
Adrian Sampson
5383d55076
Merge pull request #4616 from jackwilsdon/remove-musixmatch-default
Remove Musixmatch from default enabled sources
2023-01-02 15:29:12 -08:00
J0J0 Todos
29ed4abb52 Use join_key arg in Discogs source plugin
Fixes #4401
2023-01-02 13:47:31 +01:00
J0J0 Todos
6fb6f59c40 fromfilename: Use logging magic from inherited BeetsPlugin
and change log level to INFO.
2023-01-02 13:29:21 +01:00
J0J0 T
c1abcf3310 fromfilename: Add debug log messages
that inform when the plugin replaced bad artist, title or tracknumber metadata.
2023-01-02 13:29:21 +01:00
J0J0 Todos
5461ddf9f2 fromfilename: Move <title> regex to the very end
since it's the least significant as discussed in the PR's thread.
2023-01-02 13:29:21 +01:00
J0J0 Todos
2839302d53 fromfilename: Swap regex lines as suggested in #4561 2023-01-02 13:29:21 +01:00
Jack Wilsdon
dad9d2393d Remove Musixmatch from default enabled sources
Musixmatch are currently blocking all requests with the beets user
agent. See #4585.
2022-12-31 14:34:07 +00:00
wisp3rwind
d24cf69269 remove old Python: remove util.text_string
This was a helper for situations when Python 2 and 3 APIs returned bytes
and unicode, respectively. In these situation, we should nowadays know
which of the two we receive, so there's no need to wrap & hide the
`bytes.decode()` anymore (when it is still required).

Detailed justification:

beets/ui/__init__.py:
- command line options are always parsed to str

beets/ui/commands.py:
- confuse's config.dump always returns str
- open(...) defaults to text mode, read()ing str

beetsplug/keyfinder.py:
- ...

beetsplug/web/__init__.py:
- internally, paths are always bytestrings
- additionally, I took the liberty to slighlty re-arrange the code: it
  makes sense to split off the basename first, since we're only
  interested in the unicode conversion of that part.

test/helper.py:
- capture_stdout() gives a StringIO, which yields str

test/test_ui.py:
- self.io, from _common.TestCase, ultimately contains a
  _common.DummyOut, which appears to be dealing with str (cf.
  DummyOut.get)
2022-12-24 13:09:26 +01:00
wisp3rwind
3510e6311d web: slight refactor to make path handling more readable
(at least, more readable to me)
2022-12-24 13:09:26 +01:00
wisp3rwind
22826c6d36 drop old Python: remove obsolete custom string formatter in hooks plugin 2022-12-24 13:09:26 +01:00
wisp3rwind
67f0c73eec drop old Python: don't handle obsolte exception in keyfinder plugin 2022-12-24 13:09:26 +01:00
wisp3rwind
bd09cc90b6 drop Python 3.6: docs, a few safe simplifications 2022-12-18 09:20:04 +01:00
J0J0 Todos
87ed0f12ea Add --pretend option to splupdate command 2022-12-06 07:03:02 +01:00
Luke Harder
f155d3ba75 bug 4406 fix v5 (tests pass again) 2022-11-22 20:40:13 -05:00
Luke Harder
4a1f25e1b1 bug 4406 fix v4 (added configurable threshold) 2022-11-22 13:25:09 -05:00
Luke Harder
252121f537 bug 4406 fix 2022-11-10 12:54:45 -05:00
Aidan Epstein
c906e55ba9 Fix recent bug that would not transcode when format was wrong
Bug introduced in c6d623241b, should_transcode would return False even when the format was different.

Also fix up tests and documentation.
2022-10-19 08:55:51 -07:00
Adrian Sampson
407b1fd013
Merge pull request #4510 from KucharczykL/KucharczykL-remove-duplicate-triphop
Remove duplicate "Trip-hop" genre
2022-10-03 11:13:06 -07:00
Adrian Sampson
1ebcbf6944
Merge branch 'master' into fix_max_bitrate_default 2022-10-03 11:02:07 -07:00
Lukáš Kucharczyk
a41a9b7aa1
Remove duplicate "Trip-hop" genre 2022-10-03 19:58:23 +02:00
Jordi Ortolá Ankum
95e0161876
Merge branch 'master' into fix_max_bitrate_default 2022-10-03 10:49:51 +02:00
Adrian Sampson
82d41446a2
Use fsdecode for template substitution
The idea in this PR is to converge on Python's `fsdecode` and `fsencode`
for argument manipulation. This seems to match up with the Python
standard library's assumptions: namely, on Windows, we use `fsdecode` to
get back to Unicode strings:
54bbb5e336/Lib/subprocess.py (L561)

So let's start by dropping this utility and going straight for
`fsdecode` here to match.
2022-10-01 16:37:47 -07:00
Adrian Sampson
675dd7b9a9
Add logging for command output on errors 2022-10-01 16:08:32 -07:00
Adrian Sampson
9803939a1c
replaygain: Fix error handling for parallel runs
The parallelism strategy in #3478, in retrospect, used a pretty funky
way to deal with exceptions in the asynchronous work---since
`apply_async` has an `error_callback` parameter that's meant for exactly
this. The problem is that the wrapped function would correctly log the
exception *and then return `None`*, confusing any downstream code.
Instead of just adding `None`-awareness to the callback, let's just
avoid running the callback altogether in the case of an error.
2022-10-01 15:47:41 -07:00
Jordi
c6d623241b Fix beets#4472 - set 'max_bitrate' default param to none 2022-10-01 01:20:30 +02:00
Alok Saboo
4692199166 Add dateype back 2022-09-17 21:05:16 -04:00
Alok Saboo
e4063b5880 remove datetype 2022-09-17 20:56:48 -04:00
Alok Saboo
85b500e41a Fix spotify_updated bug 2022-09-17 20:25:36 -04:00
Alok Saboo
d267f9a8a9 Remove f-string 2022-08-24 09:32:39 -04:00
Alok Saboo
9d8ce14e9a Cleanup mbsubmit 2022-08-24 09:24:33 -04:00
Alok Saboo
c48aef3f33 Update mbsubmit.py 2022-08-24 09:16:20 -04:00
Alok Saboo
2168292455 Update mbsubmit.py 2022-08-24 09:11:45 -04:00
Adrian Sampson
8cb314350c
Avoid BeautifulSoup deprecation warning
The `text` parameter to `SoupStrainer` was renamed to `string` in 2015
(4.4.0) and started producing a warning this year (4.11.0).
https://bazaar.launchpad.net/%7Eleonardr/beautifulsoup/bs4/view/head:/CHANGELOG
2022-08-21 09:50:53 -07:00
vicholp
fde2ad3f65 fix get item file of web plugin 2022-08-03 01:22:35 -04:00
Alok Saboo
c03537c12b Address comments 2022-08-01 08:06:42 -04:00
Alok Saboo
a8434f6c38 Add last_update 2022-07-31 10:33:16 -04:00
Adrian Sampson
c5e68f5643
Adapt to pycodestyle changes 2022-07-30 19:54:24 -04:00
Aidan Epstein
ac5634d592
Fix old alias
It looks like the convert option for wma used to be called windows media.  We could just remove this alias, but might be good to keep for backwards compatibility.
2022-07-30 16:10:58 +00:00
Alok Saboo
06825e0729 Return an empty sequence 2022-07-15 09:22:23 -04:00
Alok Saboo
28614d94dc lint 2022-07-12 10:32:55 -04:00
Alok Saboo
85e58d48a2 Update spotify.py 2022-07-12 09:30:07 -04:00
Alok Saboo
4e63c8893b refactor handle_reponse 2022-07-12 09:28:23 -04:00
Alok Saboo
e1153f7772 revert 2022-07-11 11:42:24 -04:00
Alok Saboo
d82362df3e Update spotify.py 2022-07-11 11:40:32 -04:00
Alok Saboo
525e5eafd5 revert 2022-07-11 11:36:52 -04:00
Alok Saboo
7b94bbd764 Update spotify.py 2022-07-11 11:36:08 -04:00
Alok Saboo
c2ad2b3d4c Update spotify.py 2022-07-10 13:23:10 -04:00
Alok Saboo
2bd61a7c48 Update spotify.py 2022-07-10 13:15:25 -04:00
Alok Saboo
a28f8835cb Update spotify.py 2022-07-10 13:12:38 -04:00
Alok Saboo
b64cefb0d0 Add params to debug 2022-07-10 13:11:27 -04:00
Alok Saboo
2a18ab062e Remove extra pass statement 2022-07-09 15:00:29 -04:00
Alok Saboo
82e12c6b4b Add missing whitespaces 2022-07-08 17:08:04 -04:00
Alok Saboo
27c37465e4 Merge branch 'spotify_error' into spotify_track 2022-07-08 15:00:34 -04:00
Alok Saboo
a4baa742d5 Update error code 2022-07-07 14:14:11 -04:00
Alok Saboo
5fb35128d2 Merge remote-tracking branch 'upstream/master' into spotify_track 2022-07-06 10:38:02 -04:00
Alok Saboo
e0d5de4714 Add album information to spotify tracks
update

Update spotify.py

Update spotify.py

Update spotify.py

Update spotify.py

Update spotify.py

Update spotify.py

Update spotify.py

Update spotify.py

Update spotify.py

Update hooks.py

Update hooks.py

Update spotify.py

Update spotify.py

Update spotify.py

Update spotify.py

Update spotify.py

Update spotify.py

Update hooks.py

Update spotify.py

Update spotify.py

Cleanup

more cleanup
2022-07-06 10:36:08 -04:00
Alok Saboo
c7f465f968 Address comments 2022-07-05 20:46:14 -04:00
Alok Saboo
ca4b5bcec4 lint 2022-07-04 14:34:32 -04:00
Alok Saboo
12d9b1bd22 Update exception 2022-07-04 14:31:28 -04:00
Alok Saboo
95243019e9 Update exception 2022-07-04 14:29:27 -04:00
Alok Saboo
85e124bcd0 lint errors 2022-07-04 14:15:08 -04:00
Alok Saboo
1d241b0d52 Update error handling 2022-07-04 14:12:22 -04:00
Alok Saboo
016526f30e Lint 2022-07-01 10:29:20 -04:00
Alok Saboo
6a131d2108 Address comments 2022-07-01 10:26:08 -04:00
Mark Trolley
bfe008ed24
Fix typo in Acousticbrainz warning log
Add missing space in Acousticbrainz plugin warning log.
2022-06-30 14:19:58 -04:00
Alok Saboo
decdb16a15 lint 2022-06-29 20:13:48 -04:00
Alok Saboo
54af411b62 Address comments 2022-06-29 19:54:12 -04:00
Alok Saboo
9bde98c440
Update beetsplug/spotify.py
Co-authored-by: Adrian Sampson <adrian@radbox.org>
2022-06-29 19:47:21 -04:00
toaru_yousei
91c2cd2ee5 Fix importadded plugin with reflink 2022-06-29 08:06:26 +09:00
Alok Saboo
086de854d1 Update spotify.py 2022-06-26 11:56:13 -04:00
Alok Saboo
276c551059 Update spotify.py 2022-06-26 11:46:42 -04:00
Alok Saboo
8102bd2e35 Add import 2022-06-20 16:59:03 -04:00
Alok Saboo
fc8d3fceeb Define item_types for spotify attributes 2022-06-20 16:52:05 -04:00
Alok Saboo
abe4f203b1 Changed log to debug 2022-06-18 11:23:22 -04:00
Alok Saboo
1cd78ad3c5 Change log to info 2022-06-16 09:28:07 -04:00
Alok Saboo
4d826168a4 Remove sleep 2022-06-16 09:00:17 -04:00
Alok Saboo
3c68f717e9 Added an extra second (based on other libraries) 2022-06-13 10:16:10 -04:00
Alok Saboo
8ba2c015ab Sorted imports using iSort 2022-06-13 09:57:07 -04:00
Alok Saboo
c9f9ed3b64 lint 2022-06-13 09:31:19 -04:00
Alok Saboo
a2e6680e2f Address comments 2022-06-13 09:26:15 -04:00
Alok Saboo
4bb8862b6f lint 2022-06-12 19:28:47 -04:00
Alok Saboo
c4dec04dcf Fix lint 2022-06-12 19:27:15 -04:00
Alok Saboo
71be6d5138 Add 429 API error handling 2022-06-12 19:21:38 -04:00
Alok Saboo
9a392f3157 Address try/except comment 2022-06-12 13:58:08 -04:00
Alok Saboo
3d917edd67 Update spotify.py 2022-06-12 13:31:40 -04:00
Alok Saboo
3cd6fd64ca Added comment about sleep 2022-06-12 13:30:23 -04:00
Alok Saboo
f77a146f17 remove force config option 2022-05-17 20:52:30 -04:00
Alok Saboo
b2a90bf089 Changed spotify labels based on comment 2022-05-17 15:43:16 -04:00
Alok Saboo
9420cf4c6c Address comments 2022-05-17 15:04:45 -04:00
Alok Saboo
39600bcbbb
Update beetsplug/spotify.py
Co-authored-by: Adrian Sampson <adrian@radbox.org>
2022-05-17 14:50:34 -04:00
Alok Saboo
d313da2765
Update beetsplug/spotify.py
Co-authored-by: Adrian Sampson <adrian@radbox.org>
2022-05-17 14:50:27 -04:00
Alok Saboo
c66225708e
Update beetsplug/spotify.py
Co-authored-by: Adrian Sampson <adrian@radbox.org>
2022-05-17 14:50:14 -04:00
Alok Saboo
72e037f1ed Update spotify.py 2022-05-13 10:13:15 -04:00
Alok Saboo
80843d7720 Update spotify.py 2022-05-13 10:08:56 -04:00
Alok Saboo
f6c0bdac75 revert 2022-05-13 10:03:08 -04:00
Alok Saboo
4eb83e8d97 Save track popularity during the import to save an API call 2022-05-13 09:58:12 -04:00
Alok Saboo
d465471308 Add force option in config 2022-05-13 08:42:17 -04:00
Alok Saboo
4c4cafbf04 Update spotify.py 2022-05-12 20:42:13 -04:00
Alok Saboo
9c9f52b7e5 remove logging 2022-05-12 20:40:03 -04:00
Alok Saboo
db1c77fb25 Update spotify.py 2022-05-12 20:38:01 -04:00
Alok Saboo
ba3a582483 Update spotify.py 2022-05-12 20:36:04 -04:00
Alok Saboo
e8de749eaf Clean up docstrings 2022-05-12 20:24:40 -04:00
Alok Saboo
b1ad49a054 Update spotify.py 2022-05-12 20:09:40 -04:00
Alok Saboo
1b02d65112 Fix return 2022-05-08 12:42:20 -04:00
Alok Saboo
1d43ea2dba Save Spotify album_id and track_id as flexible attributes 2022-05-08 12:21:44 -04:00
olgarrahan
a26a530996 replace_br function added to reduce code duplication 2022-04-17 15:25:14 -04:00
olgarrahan
16d74bafc3 Genius lyrics header bug fixed and updated test case for lyrics plugin 2022-04-16 13:19:13 -04:00
olgarrahan
c0bb2ff2a1 Genius lyrics header bug fixed and updated test case for lyrics plugin 2022-04-15 16:37:05 -04:00
Benedikt
1167453ed8
Merge pull request #4313 from wisp3rwind/pr_artresizer_oo
Refactor: ArtResizer backends are classes
2022-03-23 23:05:43 +01:00
wisp3rwind
b76a3fcaa4 artresizer: move ImageMagick/PIL code from thumbnails plugin to ArtResizer
Makes the dispatch to the chosen backend simpler in the thumbnails
plugin. Given that ArtResizer is not only about resizing art anymore,
these methods fit there quite nicely.
2022-03-12 23:34:46 +01:00
wisp3rwind
8a969e3041 artresizer: backend classes part 1: stub classes, version checks 2022-03-12 19:48:45 +01:00
Adrian Sampson
bf66895191
Merge pull request #4302 from DucNg/auto_keep
Add auto_keep option to convert plugin - attempt to fix #1840
2022-03-11 08:09:09 -05:00
Duc Nguyen
c4281ddacc add some documentation 2022-03-09 18:34:31 +01:00
Duc Nguyen
a2325e72ad refactoring 2022-03-04 10:42:18 +01:00
Duc Nguyen
af5858d200 doc + linter + changelog 2022-03-04 10:42:17 +01:00
Duc Nguyen
18e8b73c33 add option to convert items after import
convert items after imports but also keep original files intact
2022-03-04 10:40:59 +01:00
J0J0 T
c85f903cae Revert "discogs: Add extract_release_id_regex sanity check"
This reverts commit c3cc055fdd3830bbe1c5470fe540684278a6ecc7.

We assume the Discogs API never returns a release response without an
URI.
2022-03-04 08:17:49 +01:00
J0J0 T
b609047d64 discogs: Add extract_release_id_regex sanity check
Check whether any input worth pattern checking was passed.
2022-03-04 08:17:49 +01:00
J0J0 T
c9c1123756 discogs: Fix discogs_albumid extraction
Use extract_release_id_regex instead of extract_release_id to get the
release ID out ouf the Discogs release URL.
2022-03-04 08:17:49 +01:00
Joseph Heyburn
4bde4d082d discogs: allow style to be appended to genre
- Added more verbose documentation to `append_style_genre`
- Refactor based on code review
2022-03-03 10:03:31 +00:00
Joseph Heyburn
55e4917df3 discogs: allow style to be appended to genre
- Adds a configuration that, when enabled, will append the style to genre
- Rationale is to have more verbose genres in genre tag of players that only support genre
2022-03-02 22:04:36 +00:00
Adrian Sampson
5f45e9e108
Tiny wording tweaks for #4281 2022-02-16 16:34:38 -05:00
Jaime Marquínez Ferrándiz
fedb8b0b8f fish plugin: Assign the default output path to the option instead of using None 2022-02-16 21:42:08 +01:00
Jaime Marquínez Ferrándiz
b46b4d2045 fish plugin: Simplify directory creation 2022-02-16 21:34:24 +01:00
Jaime Marquínez Ferrándiz
40fcb25221 fish plugin: Split long line 2022-02-16 08:15:30 +01:00
Jaime Marquínez Ferrándiz
8e5156d01c fish plugin: Add --output option 2022-02-15 23:11:30 +01:00
Adam Fontenot
07eb26f276 Resize album art when embedding (convert plugin)
Fixes #2116
2022-02-09 23:52:21 -08:00
Adrian Sampson
088cdfe995
Revert some of #4226
Rectify a couple of things in that PR, pointed out here:
https://github.com/beetbox/beets/pull/4226#issuecomment-1011499620

- Undo the `pretend` sensitivity in the import path, because it's not
  clear how this setting could ever be true.
- Preserve the log message in debug mode, even when quiet.
2022-01-29 18:31:48 -05:00
wisp3rwind
8572e9bcec replaygain: add docstrings 2022-01-22 14:00:32 +01:00
wisp3rwind
d19cc593e3 replaygain: better types to represent peak methods
thanks @ybnd in review https://github.com/beetbox/beets/pull/3996 for
this suggestion to properly represent the sum type
2022-01-22 14:00:32 +01:00
wisp3rwind
80f7c58e5a replaygain test: add basic per_disc testcase
The per_disc codepath is currently not exercised at all by the tests.
This test is not very meaningful, but better than nothing.
2022-01-22 14:00:32 +01:00
wisp3rwind
a2df6df9da replaygain: store_track, store_album are methods on *Task
Also, add a convenience function `store()` that dispatches two the
either of the two methods. This will be useful later, when rewriting the
parallel code (but doesn't simplify the code now).
2022-01-22 14:00:32 +01:00
wisp3rwind
9ead9cdbb8 replaygain: pass the write flag explicitly
The variable was previously captured by the closure. This is in
preparation for moving these nested functions elsewhere.
2022-01-22 14:00:32 +01:00
wisp3rwind
ad75cbf4a5 replaygain: Flatten data structures
Now that we have the *Task objects, the AlbumGain tuple can be removed.
2022-01-22 14:00:32 +01:00
wisp3rwind
67d85d18ad replaygain: introduce Task objects to bundle the state related to computations
Renames *GainHandler -> *Task and instead of having a singleton
instance, creates a *Task object for each album/item to process. The
advantage is that now, related data can be bundled in the instance,
instead of passing multiple arguments around.
2022-01-22 14:00:32 +01:00
wisp3rwind
ae3e95f9d3 replaygain: Convert the ad-hoc tag_specific_values to classes
The plugin has loads of indirection and nested functions which make it
really hard to reason about. The larger picture here is that I'd like to make
the code more manageable before reworking the parallelism issues.

In particular, instead of manually implementing an interface using a
function that returns a tuple of function pointers, this commit creates proper
classes. Again, no functionality is changed, this only moves code
around.
2022-01-22 14:00:32 +01:00
wisp3rwind
edf2bda1ce replaygain: store backend name as class attribute
Doesn't change any functionality, but appears a little cleaner to me.
2022-01-22 14:00:32 +01:00
wisp3rwind
96025c6de6 replaygain: avoid determining the method again and again 2022-01-22 14:00:32 +01:00
wisp3rwind
3eb49fca2e replaygain: clarify docs for overwrite/force and actually respect it correctly
The code used to always check the 'overwrite' config value, while that
should only apply during imports. The manual 'replaygain' command has it's
own '-f' flag.

The logic for this flag was changed quite a few times recently, see

https://github.com/beetbox/beets/pull/3816
https://github.com/beetbox/beets/issues/3872
https://github.com/beetbox/beets/pull/3890

but apparently we (me and @ybnd) never really got it right...
If it is some comfort, the logic was never correct in the first place.
2022-01-22 14:00:32 +01:00
wisp3rwind
6689502854 replaygain: rewrite long conditionals in a more imperative manner (2/2)
This is significantly easier to parse (for me, at least).
Also, void building some lists inside of any(...) in the process.
2022-01-22 14:00:32 +01:00
wisp3rwind
356a775c5e replaygain: rewrite long conditionals in a more imperative manner (1/2)
This is significantly easier to parse (for me, at least).
Also, void building some lists inside of any(...) in the process.
2022-01-22 14:00:32 +01:00
wisp3rwind
807f124ef8 really remove all six imports
apparently, pyupgrade didn't know how to handle these...
2022-01-20 00:26:01 +01:00
Adrian Sampson
b5762bd381
Merge branch 'master' into discogs_skip_untagged 2022-01-10 18:53:12 -08:00
ybnd
414760282b Remove footer text from Genius lyrics 2022-01-10 22:09:03 +01:00
ybnd
3f896ab281 Make Tekstowo scraper more specific 2022-01-10 19:03:36 +01:00
J0J0 T
e35c767e2c Skip Discogs query on insufficiently tagged files
- When files are missing both, album and artist tags, the Discogs metadata
  plugin sends empty information to the Discogs API which returns arbitrary
  query results.
- This patch catches this case and states it in beets import verbose output.
2022-01-10 08:27:18 +01:00
mousecloak
438262844a
Fixed style violation 2022-01-07 21:39:19 -08:00
Adrian Sampson
c38f10e16e
Merge branch 'master' into convert-logging-respect-quiet 2022-01-07 21:34:19 -08:00
mousecloak
ec06694097
Makes the import converter respect the quiet and pretend flags.
When the delete_originals was set, beets would print the following, regardless
of the presence of the quiet parameter:

convert: Removing original file /path/to/file.ext

This commit ensures that the log is only printed when quiet is not present.
2022-01-07 21:29:43 -08:00
Lars Kruse
a09c80447a beetsplug/web: fix translation of query path
The routing map translator `QueryConverter` was misconfigured:
* decoding (parsing a path): splitting with "/" as tokenizer
* encoding (translating back to a path): joining items with "," as separator

This caused queries containing more than one condition (separated by a
slash) to return an empty result.  Queries with only a single condition
were not affected.

Instead the encoding should have used the same delimiter (the slash) for the
backward conversion.

How to reproduce:
* query: `/album/query/albumartist::%5Efoo%24/original_year%2B/year%2B/album%2B`
* resulting content in parsed argument `queries` in the `album_query` function:
    * previous (wrong): `['albumartist::^foo$,original_year+,year+,album+']`
    * new (correct): `['albumartist::^foo$', 'original_year+', 'year+', 'album+']`
2022-01-06 22:00:26 +01:00
Adrian Sampson
5d0442f094
Merge pull request #4190 from patrick-nicholson/limit-plugin
Limit plugin
2021-12-27 17:01:09 -08:00
patrick-nicholson
a3754f7592 Test failing due to unidentified argument processing issue; replacing with API calls gives expected results.
Fixed some linting issues.
2021-12-27 13:26:38 -05:00
patrick-nicholson
6c64ab6df1 Noticed GitHub linter wanted a docstring. 2021-12-27 12:11:18 -05:00
patrick-nicholson
24bc4e77e2 Being more careful about truthiness and catching negative values (they could be supported, but it's probably not intuitive).
Moving command into single plugin as suggested.

Fixing linter objections.
2021-12-26 21:56:57 -05:00
Adrian Sampson
17410cdbb5
Merge branch 'master' into deezer-paginate 2021-12-19 07:32:12 -08:00
Dominik Schrempf
969f045610
fix deezer pagination
See #4180, and #4198.
2021-12-19 00:55:20 +01:00
Dominik Schrempf
fd761cb1e6
fix spotify pagination
Basically, keep fetching tracks until there are no more available for
the specified album.

Fixes #4180.
2021-12-19 00:16:07 +01:00
Adrian Sampson
3fcedba5c9
Merge branch 'master' into pr_deezer_tolerate_missing_fields 2021-12-12 14:33:30 -05:00
ybnd
82a2a22365 deezer: Tolerate missing fields when searching for singletons 2021-12-12 15:49:29 +01:00
ybnd
ca37c94337 kodiupdate: Support multiple instances 2021-12-12 13:39:18 +01:00
Patrick Nicholson
cdb6b21f1a Adding limit and its documentation 2021-12-07 18:47:55 -05:00
tummychow
74522b41a9 Add default for unimported.ignore_subdirectories 2021-12-01 10:54:33 -08:00
Ramon Boss
69fe1d1baf
fix: use query param for genius search 2021-11-30 20:10:56 +01:00
Adrian Sampson
c03e0ebef0
Merge pull request #4160 from beetbox/filter-img-filename
aura: Sanitize filenames in image IDs
2021-11-26 15:50:32 -05:00
Adrian Sampson
1fad3d01ae
aura: Sanitize filenames in image IDs
When constructing paths to image files to serve, we previously spliced
strings from URL requests directly into the path to be opened. This is
theoretically worrisome because it could allow clients to read other
files that they are not supposed to read.

I'm not actually sure this is a real security problem because Flask's
URL parsing should probably rule out IDs that have `/` in them anyway.
But out of an abundance of caution, this now prevents paths from showing
up in IDs at all---and also prevents `.` and `..` from being valid
names.
2021-11-26 15:35:07 -05:00
Arsen Arsenović
0b578a3384
fetchart: add option to force cover format 2021-11-03 13:31:33 +01:00
Piotrek Kochański
4d94bf8fad Merge branch 'master' of github.com:beetbox/beets into deinterlace 2021-11-01 21:33:27 +01:00
Benedikt
82285052b1
Merge pull request #4130 from wisp3rwind/pr_rm_gmusic
remove the gmusic plugin
2021-11-01 18:40:34 +01:00
Piotrek Kochański
1a130059e8 deinterlace option to affect when no other processing
remove interlacing by default when resizing/down-scaling, the
`deinterlace` option is to remove interlace when otherwise no processing
would have happened.
2021-11-01 13:51:57 +01:00
Piotrek Kochański
417ef0d453 Merge branch 'master' of github.com:beetbox/beets into deinterlace 2021-10-31 13:27:00 +01:00
Tianon Gravi
6e434934d4 Remove completed TODO item 2021-10-30 11:19:21 -07:00
wisp3rwind
786236f046 remove the gmusic plugin 2021-10-30 14:46:14 +02:00
Tianon Gravi
9ddc75035a Fix duplicated output in "beet export" 2021-10-27 09:06:27 -07:00
Tianon Gravi
7bd36ed6ca Add "beet export --album" (matching "beet info --album") 2021-10-27 08:55:36 -07:00
Tianon Gravi
a5b5831d28 Switch "beet info --album" approach to use a named argument instead
These functions are also used by the export plugin, so it's useful if the signature stays backwards compatible.
2021-10-27 08:27:39 -07:00
Tianon Gravi
d8cff030a6 Add a basic "--album" flag to "beet info"
This currently implies "--library" because I'm not sure what "album info" of the tags of individual files would mean.
2021-10-26 09:00:31 -07:00
maffo999
c824d4d773 Fix for 4108 2021-10-21 16:32:23 +02:00
Jay DesLauriers
b05432aed0 feat(unimported): support excluding subdirectories 2021-10-12 17:28:43 +00:00
Andrew Rogl
b880e2db8a Final clean up 2021-10-05 13:00:38 +10:00
Andrew Rogl
f7539b3ec3 Update to extract regex testing from album_for_id 2021-10-04 17:38:35 +10:00
Andrew Rogl
db0431deed Updated as per feedback from @wisp3rwind
I think I have the match.group correct
I'll also try and look at tests to make sure we can check
2021-10-04 10:53:06 +10:00
Andrew Rogl
a8b8d05ac5 Update comment around Discogs-ID 2021-10-03 10:23:10 +10:00
Andrew Rogl
ade9978f7e Updated after feedback from @wisp3rwind 2021-10-02 21:39:26 +10:00
Andrew Rogl
39def81d1c Fix lint error 2021-10-02 14:20:17 +10:00
Andrew Rogl
c4f2fffb63 Fix #4080
Tested with
https://www.discogs.com/SHOUSE-Love-Tonight-Robin-Schulz-Remix/release/20356324
https://www.discogs.com/release/20356324-SHOUSE-Love-Tonight-Robin-Schulz-Remix
2021-10-02 14:12:01 +10:00
Adrian Sampson
a0365e6f1c
Merge branch 'master' into pr_fix_lyrics_bs 2021-09-28 16:04:06 -04:00
Andrew Rogl
237bd07508 Address feedback from @sampsyo 2021-09-28 18:05:44 +10:00
wisp3rwind
a23857fc64 lyrics: fix crash when beautifulsoup4 is not installed
Fixes #4027
2021-09-28 00:31:42 +02:00
Andrew Rogl
ac6cc2ffa4 Fix up invalid master merges 2021-09-26 17:33:15 +10:00
Andrew Rogl
ed07bb5b7e
Merge branch 'master' into pyupgrade 2021-09-26 17:22:15 +10:00
Andrew Rogl
fc4d65a387 Missed a few unicode strings 2021-09-26 16:51:01 +10:00
Andrew Rogl
5859d31405 Commit #4036 2021-09-26 16:41:13 +10:00
Andrew Rogl
6cd7998c3d Forgot to pyupgrade new file 2021-09-26 16:27:20 +10:00
Andrew Rogl
8205b901db Commits #4048 & #4050 2021-09-26 16:03:00 +10:00
Duncan Overbruck
f5e336747a
Add permissions test case for set_art event 2021-09-12 16:40:58 +02:00
Duncan Overbruck
264e771e7c
permissions: set album art permissions 2021-09-12 16:40:44 +02:00
Edgars Supe
d40f0c8860 Fill default config for albumtypes plugin 2021-09-10 14:48:28 +03:00
Edgars Supe
131befa132 Improve albumtypes plugin code 2021-09-10 10:23:47 +03:00
Edgars Supe
bee35885bb Add albumtypes plugin 2021-09-09 23:05:12 +03:00
Andrew Rogl
9106b41a50 Remove as many as possible sys.version tests 2021-08-27 10:24:27 +10:00
Piotrek Kochański
d30c8b32b5 Remove unnecessary line break. 2021-08-26 15:02:51 +02:00
Andrew Rogl
ee4268dabb Remove unused imports
Fix imports
Fix formatting
2021-08-26 20:59:48 +10:00
Andrew Rogl
1ec87a3bdd pyupgrade beetsplug and tests
All tests working
More tidy up to be done
2021-08-26 19:12:51 +10:00
Piotrek Kochański
0a0719f9ed Add plugin option to store cover art non-progressive. 2021-08-25 22:56:46 +02:00
Adrian Sampson
fd81d65c4b
Undo string type inversion in convert 2021-08-21 13:24:18 -04:00
Adrian Sampson
e6a1f5a3dc
convert: Split command in str form
...with yet another round-trip conversion. :/
2021-08-19 17:24:01 -04:00
Adrian Sampson
2f5f9ea174
Remove shlex_split utility
This works around a bug that does not exist in Python 3.x, and the
workaround (by calling the underlying shlex.split function with bytes)
was causing crashes on some versions of Python 3. Seemed to work fine on
3.10-dev, though, oddly.
2021-08-19 17:14:16 -04:00
Adrian Sampson
75c41c0546
Remove most six.PY2 checks 2021-08-19 16:45:11 -04:00
Kirill A. Korinsky
b0f7418372
Stream-friendly smart playlists
This commit introduced a way to generate a stream-frienldy playlists.
2021-08-14 02:41:22 +02:00
maffo999
5dbc7f9f33 Moved logging to debug and fixed empty line. Updated changelog to include new option. 2021-07-15 20:13:18 +02:00
maffo999
653181a296 Fix subsonicupdate plugin 2021-07-14 20:10:04 +02:00
wisp3rwind
0c285753fb lyrics: Add some missing None-checks to the Tekstowo source
The previous code had the potential to crash if (when?) Tekstowo changes
their website structure sufficiently.

The new code is rather ugly due to the explicit checks after each and
every function call. Unfortunately, the alternative would be to catch a
bunch of very generic Exceptions (AttributeError, ...), since there's no
such thing as a `BeautifulSoupNotFoundError`.
2021-07-04 10:38:00 +02:00
wisp3rwind
09be82bd75 lyrics: slightly more consistent white space in Tekstowo source 2021-07-04 00:35:42 +02:00
Martin Atukunda
efcc5b3fae
return None for lyrics if Tekstowo fails to extract lyrics
I experienced a failure to parse Tekstowo for song lyrics. 

This patch allowed the lyrics plugin to fetch the lyrics from another provider as opposed to failing.
2021-07-01 09:39:42 +03:00
wisp3rwind
d6ca1cc242 duplicates: fix crash when query return empty results 2021-06-18 17:18:50 +02:00
wisp3rwind
316b79f72f lyrics: slightly refactor beautifulsoup checks
instead of having a global list of sources that require the package,
indicate the dependency using an attribute of the source class
2021-06-18 17:16:04 +02:00
wisp3rwind
038cebfa9b lyrics: remove duplicate check for beautifulsoup
The plugin already disables these sources entirely when beautifulsoup is
not available
2021-06-18 17:16:04 +02:00
wisp3rwind
867d383544 lyrics: wrap BeautifulSoup() constructor to centralize error handling
also ensure that the return value is always checked for None
2021-06-18 17:16:04 +02:00
wisp3rwind
b34442f5d1 lyrics: always check for fetch_url() returning None 2021-06-18 17:16:04 +02:00
wisp3rwind
f8a4c661fa lyrics: return None explicitly 2021-06-18 17:16:04 +02:00
wisp3rwind
76aa97827d lyrics: rename html -> soup for consistency 2021-06-18 17:16:04 +02:00
Andrew Rogl
51d922df27 Merge branch 'master' into fix_#2873 2021-05-24 16:21:27 +10:00
Andrew Rogl
81e50cb630 Too quick to delete 2021-05-23 15:43:14 +10:00
Andrew Rogl
39ca5b7be6 Changes as requested 2021-05-23 14:45:02 +10:00
sandersantema
f3e1d90470
Avoid usage of walrus operator which is only compatible with > 3.8 2021-05-13 12:58:26 +02:00
sandersantema
2cd15a7434 Add itunes_dateadded to itunes metasync plugin 2021-05-13 12:32:42 +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
Xavier Hocquet
8b979f2a50 Review comments 2021-04-11 18:38:01 -05:00
Xavier Hocquet
31f4df3ff3 Fix falso positive lyric pages for Tekstowo 2021-04-11 17:30:45 -05: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
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
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
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
3e1fe88053 Merge branch 'master' of https://github.com/beetbox/beets 2021-03-24 16:59:24 -05:00
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
Cadel Watson
76220fb148 Add DELETE method for items and albums 2020-09-20 10:18:07 +10:00
djl
33b10d60fb
fetchart: Improve Cover Art Archive source. (#3748)
* fetchart: Improve Cover Art Archive source.

Instead of blindly selecting the first image, we now treat all "front"
images as candidates.

This is useful where some digital releases have both an animated cover
and a still image and the animated image is the first image returned
from the API.
2020-09-13 20:27:12 +01:00
Jef LeCompte
f2a4864ab0
Merge pull request #3731 from jef/jef/fix-subsonic 2020-09-04 08:06:55 -04:00
Jef LeCompte
3c8419dbe0
fix(plugin): subsonicupdate rest call
Signed-off-by: Jef LeCompte <jeffreylec@gmail.com>
2020-09-04 00:51:03 -04:00
PotcFdk
2039f26f96 Update file metadata after generating fingerprintsthrough the submit command. 2020-08-26 13:36:40 +02:00
ybnd
e1876590ba Fix replaygain.py to pass test_replaygain.py 2020-08-12 12:49:16 +02:00
ybnd
72710cd8c7 Merge branch 'master' into parallel-replaygain 2020-08-12 11:59:32 +02:00
ybnd
50757d34ad Fix conflicts 2020-08-12 11:42:18 +02:00
Aidan Epstein
fce27e6fa9 mpdstats: Don't record a skip when stopping MPD.
MPD keeps the current track in the queue when stopping, so it's not
really like a skip, and I use it so that I can stop the music, and later
start at the beginning of a track.

I do this by keeping track of the current song id, and then comparing
them when we receive a stop signal.
2020-08-10 07:07:17 -07:00
soergeld
d748cc7744 small problem with parent composer 2020-08-09 18:56:52 +02:00
Samuel Cook
b89a2650cc
Delete after convert (#3700)
* If import move is true, files will be deleted after converting.
Fixes #2947

* Removed trailing whitespace to comply with W293, fixing build

* Add period to the end of the comment

Co-Authored-By: Adrian Sampson <adrian@radbox.org>

* Added changelog entry for this fix.

* Added delete_originals option to remove source files after transcode

* Added unit test, removed redundant syspath call

Co-authored-by: Logan Arens <logan-arens@users.noreply.github.com>
Co-authored-by: Logan Arens <heresmygithub@protonmail.com>
Co-authored-by: Adrian Sampson <adrian@radbox.org>
Co-authored-by: Logan Arens <logan.arens@protonmail.com>
2020-08-03 20:20:20 -05:00
Gunther Schmidl
48d39ea11e fix regex, add test and changelog entry 2020-07-30 22:42:31 +02:00
FichteFoll
eda9930c59
Merge remote-tracking branch 'upstream/master' into pr/item-album-fallback 2020-07-27 19:32:44 +02:00
jtpavlock
335776ff30
Merge pull request #3666 from jtpavlock/flake8-errors
Unignore flake8 E221, E226, E242, E704
2020-07-20 12:24:52 -07:00
José Albornoz
dc7e433768
Fix thumbnail plugin pathlib bug (#3360)
PathlibURI.uri() would fail if given a path as bytes instead of as string.

Co-authored-by: Jacob Pavlock <jtpavlock@gmail.com>
2020-07-15 21:00:50 -05:00
Adrian Sampson
8537d1e36d Merge pull request #2554 from musoke/python3-plugin-ipfs
compatibility of IPFS plugin with Python 3
2020-07-14 06:58:20 -04:00
soergeld
770664f27d typo 2020-07-13 23:05:53 +02:00
wisp3rwind
44e4d558c9 lyrics: fix bad_triggers in the google plugin
regression from 117d16f
2020-07-12 22:23:17 +02:00
Jacob Pavlock
124c882b4d un-ignore E221 2020-07-11 18:33:08 -07:00
Adrian Sampson
32e54a29fa
Merge pull request #3655 from aereaux/add_parentwork_date
Get the date of the parentwork, which may be different from the date of the child work.
2020-07-07 07:48:23 -04:00
jtpavlock
45abc9ed7a
Clean up code and tests for Genius Lyrics plugin backend (#3641)
* clean-up code & add tests for genius lyrics backend

* add genius fetch tests

* organize imports: standard lib -> pip -> local

* check in sample genius lyrics page

* fix mock import

* force utf-8 encoding for opened files

* use io.open to force utf-8 encoding w/ python2.7
2020-07-06 08:41:27 -05:00
Aidan Epstein
27199abac8 Get the date of the parentwork, which may be different from the date of the child work.
Also add a changelog entry and docs.
2020-07-03 09:35:15 -07:00
Mark Trolley
0f767ffa66 fetchart: Use Cover Art Archive thumbnails
The Cover Art Archive API offers pre-resized thumbnails of cover
art. If the `maxwidth` option of `fetchart` matches one of the
supported Cover Art Archive thumbnail sizes, and a thumbnail of
that size exists in the Cover Art Archive, fetch it directly
instead of fetching the full size image then resizing it.
2020-06-28 17:18:42 -04:00
Adrian Sampson
533cc88df2
Merge pull request #3639 from trolley/topic/coverart-fallback
Revert Cover Art Archive thumbnails
2020-06-27 19:46:45 -04:00
Adrian Sampson
3e32a4fb87
Merge pull request #3635 from jtpavlock/master
Fix genius lyrics backend artist matching with hyphens
2020-06-27 19:38:26 -04:00
Mark Trolley
a4c647be46 Revert "fetchart: Use Cover Art Archive thumbnails"
This reverts commit 2131f6f7d9.
2020-06-27 16:26:52 -04:00
Mark Trolley
3232a5b8b7 Revert "Indentation fix"
This reverts commit 1e527ed4e5.
2020-06-27 16:26:20 -04:00
Adrian Sampson
1e527ed4e5 Indentation fix 2020-06-27 12:49:32 -04:00
Mark Trolley
2131f6f7d9 fetchart: Use Cover Art Archive thumbnails
The Cover Art Archive API offers pre-resized thumbnails of cover
art. If the `maxwidth` option of `fetchart` matches one of the
supported Cover Art Archive thumbnail sizes fetch it directly
instead of fetching the full size image then resizing it.
2020-06-27 12:34:43 -04:00
Jacob Pavlock
7220c91d2a generalize genius artist matching to use slug() 2020-06-26 18:56:20 -07:00
Jacob Pavlock
bb5740d63c better debug message for no genius artist match 2020-06-26 16:41:20 -07:00
Jacob Pavlock
ae175e156b fix genius lyrics artist matching when artist contains a hyphen 2020-06-26 16:10:33 -07:00
Mark Trolley
6d41f31309 Rename use_secure to secure and add to changelog 2020-06-08 20:19:19 -04:00
Mark Trolley
22d74a3b8a feat: support secure Plex connections 2020-06-08 18:05:43 -04:00
Adrian Sampson
3aad6f42ce Merge pull request #3602 from jef/jef/github-actions
feat: added github actions
2020-06-05 09:56:59 -04:00
ybnd
d1f3d664d7 Implement comments & add to changelog 2020-06-04 16:43:42 +02:00
ybnd
b239a0b3d2 Fix item == None issues when writing lyrics ReST
* Skip ReST writing & sphinx info messages if query doesn't yield anything
* `writerest` into `appendrest` and `writerest`, don't call `writerest(item=None)` to flush state at the end.
2020-06-04 11:15:34 +02:00
Jef LeCompte
42e5844564
fix: revert flake8 change 2020-06-04 02:09:04 -04:00
Jef LeCompte
9f8bd4cd3f
style: flake8 linting 2020-05-25 20:06:43 -04:00
Jef LeCompte
0c3201930c
feat: added github actions
only working with linux for now. exact replica of travis basically.
should probably try to implement the rest of tox or deprecate some
functionality.
2020-05-25 19:35:15 -04:00
Jef LeCompte
66e6b11404
refactor: moved static methods inside class
made them static private class methods
2020-05-22 21:23:25 -04:00
Jef LeCompte
d9603788bc
fix: use endwith() instead of endWith() 2020-05-22 21:23:25 -04:00
Jef LeCompte
1374aa2aea feat: uses new subsonic format as default
also gets rid of warning that port must be `int` when it's default was a `string`
2020-05-18 10:23:26 -04:00
Adrian Sampson
485abb08c0 Merge pull request #3594 from stlutz/master
Scrape new Genius song page html
2020-05-17 14:44:57 -04:00
stlutz
5d306d6fd9 Remove debugging statement and conform to line length. 2020-05-16 17:48:56 +02:00
stlutz
15402f6aa7 Add alternative scraping algorithm to deal with Genius's new song page html layout. 2020-05-16 17:15:45 +02:00
stlutz
46143d9762 Remove unnecessary intermediate web request to genius.com when fetching lyrics.
The search results already include the correct song page url, making it superfluous to do another request via the /song api just to get it.
2020-05-16 16:28:17 +02:00
Adrian Sampson
d4a82b1fa5
Merge pull request #3592 from thenktor/patch-2
Update genres-tree.yaml
2020-05-16 10:03:44 -04:00
stlutz
ac043f9be0 When fetching lyrics from Genius, search for title and artist.
Searching only for the title and just verifying the artist afterwards leads to songs with very common titles not being found, since Genius limits the amount of returned hits.
An example would be 'Saviour' by 'Circa Waves'.
2020-05-16 13:26:09 +02:00
Thorsten
852cdb6dfa
Update genres-tree.yaml
Added more heavy metal genres: https://en.wikipedia.org/wiki/Heavy_metal_genres
2020-05-16 00:34:37 +02:00
Thorsten
05d202760b
Update genres.txt
Added more heavy metal genres: https://en.wikipedia.org/wiki/Heavy_metal_genres
2020-05-16 00:34:10 +02:00
soergeld
fe418b946e forgot one mb_workid_current occurence 2020-05-14 22:40:37 +02:00
Adrian Sampson
b3656bcab9
Merge pull request #3586 from dosoe/beet_update_parentwork
Fetching parentwork if changed, even if not force
2020-05-14 08:26:30 -04:00
Adrian Sampson
1dcfa03b5b Merge branch 'master' of github.com:beetbox/beets 2020-05-13 08:21:09 -04:00
Adrian Sampson
5db2b4ccaa Fix new flake8 warnings 2020-05-13 08:20:50 -04:00
soergeld
918fea5eca small changes, documentation 2020-05-12 16:05:08 +02:00
Adrian Sampson
4ea69da745
Merge pull request #3588 from MrNuggelz/subsonicplaylist
Fix: subsonicplaylist wrong song selection
2020-05-11 19:11:19 -04:00
MrNuggelz
fd1fd2182b changed "SubstringQuery" to "MatchQuery" to prevent wrong song selection 2020-05-11 20:09:04 +02:00
soergeld
1f93ce5a49 small changes, docs 2020-05-11 16:14:52 +02:00
soergeld
c948530279 Fetching parentwork if changed, even if not force 2020-05-10 13:05:55 +02:00
Adrian Sampson
a907dac16c
Merge pull request #3568 from dosoe/beet_test_new_albuminfo
First try adding new albuminfo and trackinfo class
2020-05-09 10:53:43 -04:00
Adrian Sampson
31a264b299
Merge pull request #3425 from MrNuggelz/subsonicplaylist
Subsonic Playlist Plugin
2020-05-09 10:52:10 -04:00
MrNuggelz
5d90296a20 fixed flake8 issues 2020-05-09 13:16:56 +02:00
Dorian Soergel
d07c1dece9
Merge branch 'master' into beet_test_new_albuminfo 2020-05-09 12:45:13 +02:00
MrNuggelz
4933671c10 review: updated subsonicplaylist.py 2020-05-08 21:37:05 +02:00
soergeld
7c71bb87a2 cleaning up, renaming dup_XXInfo() to copy() 2020-05-08 16:32:12 +02:00
pants108
1a79ae5a9f code review 1 2020-05-05 18:39:05 +00:00
pants108
a553693677 fetchart: clean up invalid tmp files 2020-05-03 17:58:44 +00:00
MrNuggelz
5c3debe236 removed unused imports 2020-05-03 16:07:27 +02:00
Joris
08180f2b5d
Merge branch 'master' into subsonicplaylist 2020-05-03 14:59:22 +02:00
MrNuggelz
13b4a1413d update all songs in one transaction 2020-05-03 14:58:34 +02:00
MrNuggelz
cb7dfe3f6f review: updated subsonicplaylist.py 2020-05-03 14:05:22 +02:00
Sören Tempel
6a03afc65d web plugin: support path queries by separating them with a backslash
Without this change the web plugin does not support path queries as
slashes are currently used for joining keywords in the QueryConverter.
Moreover, flask cannot distinguish between an URL encoded and a plain
'/' character during routing [0]. To work around this issue without
introducing a breaking change (i.e. removing the QueryConverter) use the
backslash character for path queries and convert it later on.

Fixes #3566

[0]: https://github.com/pallets/flask/issues/900
2020-04-27 13:36:36 +02:00
soergeld
f507f04639 reintroduce default arguments, adapt all occurences of TrackInfo and AlbumInfo to the absence of positional arguments 2020-04-27 11:21:13 +02:00
Adrian Sampson
47deb2f084 Switch log level for #3563, fix #3533 2020-04-23 08:03:51 -04:00
Michal Koutenský
5143e630d8 Fix #3533 - crash when calculating RG/R128 mix 2020-04-23 11:05:33 +02:00
Adrian Sampson
99dbe93f85
Merge pull request #3559 from somasis/master
fetchart: improve description of -q flag
2020-04-19 20:47:32 -04:00
Kylie McClain
1c03f58e0d
fetchart: improve description of -q flag 2020-04-19 14:56:15 -04:00
Ashhar Hasan
625e9253c0
Add tests for artist_sort as lyrics search fallback
Adjust doc comment to highlight that artist_sort is used as a fallback
2020-04-19 19:19:07 +05:30
Ashhar Hasan
45c8e51d6c
Fix redundant requests for artist == artist_sort 2020-04-19 19:14:00 +05:30
Ashhar Hasan
a5ef8c7b09
Add artist_sort as the last entry in the artists to search
This will handle cases where the artist name includes some
characters which can cause a search failure for some
websites - mainly unicode.

Fixes https://github.com/beetbox/beets/issues/3340.
2020-04-19 00:50:14 +05:30
Adrian Sampson
269e309513 Slight simplification for #3554 2020-04-17 18:28:21 -04:00
lijacky
9ec0d725e5 Changes given feedback on https://github.com/beetbox/beets/pull/3554 and trimmed sample html 2020-04-17 17:14:21 -04:00
lijacky
8e28f0b694 added null check for genius lyrics scrape 2020-04-16 19:06:17 -04:00
Jack Wilsdon
333d5d1dd3
fetchart: Add Last.fm artwork source 2020-03-30 20:20:59 +01:00
Xavier Hocquet
38ea35aa5e Lint 2020-03-28 11:44:56 -06:00
Xavier Hocquet
58bfe4567e Code review 2020-03-28 11:34:03 -06:00
Andrew Rogl
f306591a99 add the extra_tags option to all required plugins 2020-03-28 17:36:02 +10:00
Xavier Hocquet
1266a04998 Docs, lint, and cleanup beautifulsoup source check 2020-03-19 21:10:52 -06:00
Xavier Hocquet
306571883e Implement tekstowo lyrics provider 2020-03-18 23:00:51 -06:00
Justin Mayer
f465c90e78 Enforce PEP-8 compliance on Fish completion plugin 2020-03-04 07:15:46 +01:00
Justin Mayer
05db0d18eb Don't escape question marks in Fish completions
Fish shell previously interpreted question marks as glob characters, but
that behavior has been deprecated and will soon be removed. Plus, the
completion for `help` and its alias `?` does not currently seem to behave
as expected anyway and is thus, at present, of limited utility.
2020-03-04 07:15:46 +01:00
Justin Mayer
82c3867fc0 Rewrite Fish completion plugin docs & code comments 2020-03-04 07:15:46 +01:00
jmwatte
d2d2b646c1 Add plugin for Fish shell tab completion 2020-03-02 09:51:36 +01:00
Daniel Barber
fe8ba17ced Add quality setting to fetchart plugin 2020-02-22 13:36:35 -05:00
Daniel Barber
96b0e8a33e No longer need to pass a default quality here 2020-02-18 16:44:45 -05:00
Daniel Barber
036202e1c5 Default quality to 0 which means don't specify
From the ImageMagick docs: "The default is to use the estimated quality
of your input image if it can be determined, otherwise 92."

In order to get the original behaviour we need to conditional add the
quality parameter to the `magick` call. The quality range can be
anything from 1 to 100, which gives us the convenience of using 0 to
specify no specific quality level.
2020-02-18 14:50:57 -05:00
Daniel Barber
86946ad4b7 Allow the quality to be set for embedded/fetched cover art 2020-02-17 21:12:20 -05:00
Aidan Epstein
535af4bdb2 parentwork: Only call store when the metadata has changed.
Otherwise, this rewrites all your files every time.
2020-02-17 09:05:52 -08:00
Adrian Sampson
d43d54e21c Try to work around a Werkzeug change? 2020-02-06 22:22:54 -05:00
Adrian Sampson
91be732bf4 Fix whitespace (#3453) 2020-02-06 22:18:15 -05:00
Adrian Sampson
f9088a3eb7
Merge pull request #3453 from faulkt/master
added merge_environment_settings call
2020-02-06 21:54:14 -05:00
Tyler Faulk
964a6c2e63 restored whitespace to please style checker 2020-02-06 12:10:38 -05:00
ybnd
63ea17365a Modify patched stdout in test_malformed_output 2020-02-05 09:04:24 +01:00
ybnd
7005691410 Add comment to clarify unexpected AttributeError handling 2020-02-05 08:52:50 +01:00
ybnd
1ab46c69be Merge remote-tracking branch 'origin/master' into bs1770gain-v0.6.0-parsing
# Conflicts:
#	docs/changelog.rst
2020-02-05 08:45:30 +01:00
ybnd
9bd78424c1 Handle keyboard interrupts more cleanly 2020-02-04 19:16:33 +01:00
Adrian Sampson
95e0f54d7c Fix too-long lines (#3448) 2020-02-02 21:04:55 -05:00
Adrian Sampson
d4d04c61aa
Merge pull request #3448 from xhocquet/genius-lowercase-artist-fix
Genius lyrics fix for API capitalization behaviors
2020-02-02 20:46:24 -05:00
Xavier Hocquet
9f43408f1b Changelog and cleanup 2020-02-02 15:57:43 -07:00
ybnd
4970585b0a Remove temporary workaround for silent exceptions 2020-01-31 14:08:28 +01:00
ybnd
4a427182cd Handle exceptions in pooled threads
* ExceptionWatcher instance running in parallel to the pool, monitoring a queue for exceptions
* Pooled threads push exceptions to this queue, log non-fatal exceptions
* Application exits on fatal exception in pooled thread

* More front end info logs in the CLI
2020-01-31 13:50:38 +01:00
ybnd
bef473c8e8 Remove spliced progress regex and add --suppress-progress flag 2020-01-31 07:42:50 +01:00
ybnd
506be02597 Remove packaging dependency 2020-01-30 20:11:09 +01:00
ybnd
f51a68c7e1 Implement comments 2020-01-30 19:53:05 +01:00
ybnd
c3817a4c06 Implement review comments
* safer version comparison

* regex bytes directly

* handle b'\x08 ...' case

* test_replaygain.py: injected command output should match the type of the actual output
2020-01-30 19:21:53 +01:00
ybnd
65ffca215a Exception handling in main & worker threads
* With `bs1770gain` installed the `Bs1770gainBackend` tests fail, but this should be fixed by https://github.com/beetbox/beets/pull/3480.
2020-01-30 18:04:20 +01:00
ybnd
c1cb78c908 Small fixes in replaygain.Bs1770gainBackend and test_replaygain.py
* Fix unspecified `gain_adjustment` when method defined in config

* Fix difference between dB and LUFS values in case of mismatched `target_level`/`method`:

  ```
  db_to_lufs( target_level <dB> ) - lufs_to_dB( -23 <LUFS> )
  ```

* Ignore single assertion in case of bs1770gain

(cherry picked from commit 2395bf224032c44f1ea5d28e0c63af96a92b96df)
2020-01-30 17:59:57 +01:00
ybnd
c78afb1a97 Don't call bs1770gain outside of try statement 2020-01-30 17:02:28 +01:00
ybnd
53820c0a98 Handle bs1770gain v0.6.0 XML output
* Remove `0%\x08\x08` from output (backspace code doesn't resolve; progress percentages get spliced in)

* Handle changed attributes/fields:
  * `sample-peak` attribute `factor` is called `amplitude` instead
  * Album summary is not included in a `summary` tag now, but in two separate `integrated` and `sample-peak` tags

* Handle `lu` attribute

* Get bs1770gain version
  * If v0.6.0 or later, add `--unit=ebu` flag to convert `db` attributes to LUFS
  * May be useful later on

### Output examples

Track:
```
<!-- analyzing ... -->
<bs1770gain norm="-18.00">
  <track total="1" number="1" file="02 tïtle 0.mp3">
    <integrated lufs="-70.00" lu="52.00"/>
    <sample-peak spfs="-72.28" amplitude="0.00"/>
  </track>
  <integrated lufs="-70.00" lu="52.00"/>
  <sample-peak spfs="-72.28" amplitude="0.00"/>
</bs1770gain>
<!-- done. -->
```

Album:
```
<!-- analyzing ... -->
<bs1770gain norm="-18.00">
  <track total="2" number="1" file="02 tïtle 0.mp3">
    <integrated dbfs="-70.00" db="52.00"/>
    <sample-peak dbfs="-72.28" amplitude="0.00"/>
  </track>
  <track total="2" number="2" file="02 tïtle 1.mp3">
    <integrated dbfs="-70.00" db="52.00"/>
    <sample-peak dbfs="-72.28" amplitude="0.00"/>
  </track>
  <integrated dbfs="-70.00" db="52.00"/>
  <sample-peak dbfs="-72.28" amplitude="0.00"/>
</bs1770gain>
<!-- done. -->
```
2020-01-30 16:13:29 +01:00
ybnd
b903584163 Fix --threads argument handling 2020-01-30 13:31:14 +01:00
ybnd
b126ecafdd Clean up single/multithreaded execution selection logic
As suggested in https://github.com/beetbox/beets/pull/3478#discussion_r372467445
2020-01-30 12:38:20 +01:00
ybnd
0fede91bbd Workaround to pass ReplayGainLdnsCliMalformedTest.test_malformed_output ~ Python 3.8 2020-01-30 12:07:42 +01:00
ybnd
79c5535cf6 Open/close pool at begin/end of import session 2020-01-30 09:35:22 +01:00
ybnd
388d2d2c0d Consolidate ThreadPool checking, opening and closing into methods 2020-01-30 09:35:22 +01:00
ybnd
42e895c239 Match --jobs default & signature to that of convert plugin (--threads)
And change local function `func` to `ReplayGainPlugin` method `replaygain_func` so that `self` is passed explicitly
2020-01-30 09:35:22 +01:00
ybnd
d95bb5683b Analyze replaygain in parallel with multiprocessing.pool.ThreadPool
* Add `--jobs` or `-j` to `replaygain`-> set the pool size
* Single-threaded execution by default, if `--jobs` is unset

* If multithreaded, calls `Backend.compute_album_gain` or `Backend.compute_track_gain` asynchronously with metadata storing/writing in the callback
2020-01-28 21:20:21 +01:00
BrainDamage
f118314682 support for keyfinder-cli, which doesn't want the -f flag for paths 2020-01-14 05:07:33 +01:00
MrNuggelz
6d69d01016 added database changed event to subsonicplaylist 2020-01-13 15:43:20 +01:00
Adrian Sampson
a08f2315ea Simplify Confuse usage (#3463) 2019-12-26 20:44:14 -05:00
Mat
2593a5be34 Use a local var to use high resolution option 2019-12-26 21:55:48 +00:00
Mat
3570f5cd56 New high_resolution config option in fetchart 2019-12-26 17:36:56 +00:00
Cole Miller
e945ed894d
Add trailing comma
Co-Authored-By: Adrian Sampson <adrian@radbox.org>
2019-12-18 14:31:59 -05:00
Cole Miller
6c948764fe Wrap comment lines 2019-12-17 17:56:56 -05:00
Cole Miller
614289af5f Remove use of `list.clear()' for compatibility 2019-12-17 17:46:43 -05:00
Cole Miller
3ccafa2495 Fix `str.join' usage 2019-12-17 17:40:16 -05:00
Cole Miller
8805ba28fd Add comments 2019-12-17 16:33:41 -05:00
Cole Miller
02e03be93d Incorporate divisions into track titles 2019-12-17 15:38:54 -05:00
Cole Miller
e31695b606 Trace hierarchy of index tracks 2019-12-17 15:27:26 -05:00
Cole Miller
6889b9ffdc Add `index_tracks' configuration option 2019-12-17 13:43:53 -05:00
Tyler Faulk
a1af5d280e added merge_environment_settings call in fetchart plugin to handle connections with proxy servers 2019-12-10 22:54:31 -05:00
Adrian Sampson
9739e9be9b Docs tweaks for #3449 2019-12-09 15:55:31 -05:00
Jef LeCompte
89f21d9601
Updated documentation 2019-12-09 07:13:25 -05:00
Jef LeCompte
5a38e1b35c
Refactored token generation and updated comments based on suggestions.
Also updated documentation to note the password options.
2019-12-06 18:30:52 -05:00
Jef LeCompte
1690c08e77
Added URL to config and deprecated old configuration 2019-12-06 15:05:36 -05:00
Xavier Hocquet
c8e8e587f8 Add debug logger for Genius lyrics no-match 2019-12-05 20:06:49 -07:00
Xavier Hocquet
d43cf35ad2 Strip and lowercase Genius lyrics artist comparison 2019-12-05 20:06:46 -07:00
Aidan Epstein
9c479659b2 Increment playlist_version when a track is consumed.
This fixes the playlist not updating when in consume mode, at least in
ncmpcpp.
2019-11-24 19:27:09 -08:00
MrNuggelz
e9dee5dca8 added flag to delete old tags 2019-11-16 20:30:53 +01:00
MrNuggelz
bb305b17e1 set tags instead of creating m3u 2019-11-16 14:37:41 +01:00
Joris
ec696f5e58
Removed unused sanitize_path import 2019-11-11 10:48:29 +01:00
MrNuggelz
0191794285 subsonicplaylist plugin 2019-11-10 22:34:12 +01:00
msil
1f665b0290 adding discogs_labelid and discogs_artistid fields 2019-10-24 10:13:37 +00:00
Adrian Sampson
a7671e16a6 Merge pull request #3409 from jackwilsdon/hook-check-call
hook: switch to using check_call
2019-10-17 11:12:06 -04:00