Commit graph

3412 commits

Author SHA1 Message Date
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