Commit graph

243 commits

Author SHA1 Message Date
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
ghbrown
f1b7832d52 Change minimum discogs_client version to 2.3.15 2023-03-10 15:28:29 -06: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
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
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
J0J0 Todos
29ed4abb52 Use join_key arg in Discogs source plugin
Fixes #4401
2023-01-02 13:47:31 +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
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
maffo999
c824d4d773 Fix for 4108 2021-10-21 16:32:23 +02: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
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
Nick Sellen
6dc1f6414d
Remove ascii encoding step now library is fixed 2021-03-17 09:06:35 +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
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
Jacob Pavlock
124c882b4d un-ignore E221 2020-07-11 18:33:08 -07:00
soergeld
7c71bb87a2 cleaning up, renaming dup_XXInfo() to copy() 2020-05-08 16:32:12 +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
Andrew Rogl
f306591a99 add the extra_tags option to all required plugins 2020-03-28 17:36:02 +10: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
msil
1f665b0290 adding discogs_labelid and discogs_artistid fields 2019-10-24 10:13:37 +00:00
Rahul Ahuja
a5fadf0dcc Integrate MetadataSourcePlugin 2019-09-15 15:59:24 -07:00
Sebastian Pucilowski
a2ee8da8d6 Refactor magic values in discogs_client 2019-08-11 11:21:22 +10:00
Guilherme Danno
4908028985
Use the 'resource_url' from discogs_client 2019-07-30 16:46:59 -03:00
Adrian Sampson
e39341b282 Merge pull request #3322 from thedevilisinthedetails/master
465 discogs: Fetch a few more metadata fields
2019-07-01 17:22:50 -04:00
Peter
0cd46dab77 fixing per review comments 2019-07-01 21:04:35 +02:00
Peter
e196c1dae6 fixing test 2019-06-30 13:54:38 +02:00
Peter
510276f653 fixing test 2019-06-30 13:44:13 +02:00
Peter
90cf579ee3 adding genre, released_date and discogs_release_id 2019-06-16 21:55:35 +02:00
Adrian Sampson
ed30a7aed2 Merge pull request #3251 from thedevilisinthedetails/master
#2579 Adding styles to discogs plugin
2019-06-10 13:26:09 -04:00
Peter
7ec1fc934b removing unneeded condition 2019-06-10 15:54:19 +02:00
Peter
9bdadc5c73 removing extra line 2019-06-10 09:33:10 +02:00
Peter
55e003a3d4 fixing per review comments 2019-06-10 09:11:38 +02:00
Peter
f0c91b8f45 fixing per review comments 2019-06-09 20:01:55 +02:00
Peter
2c49c12166 fixing per review comments 2019-06-09 15:44:37 +02:00
Peter
5fc21a1e21 fixing per review comments 2019-06-09 15:39:49 +02:00
Peter
851c413976 adding config option for seperator and addressing review comments 2019-06-09 10:37:33 +02:00
FichteFoll
728203e15a
beets.io now supports HTTPS
See https://github.com/beetbox/beets/pull/3297.
2019-06-06 15:34:15 +02:00
Carl Suster
6382c364e2 confit: replace with confuse in plugins 2019-06-01 10:03:41 +10:00
Peter
6ffbd5af45 adding styles to hook and returning Style not Defined if no style set 2019-05-05 11:44:24 +02:00
Peter Koondial
8fcff5ddc7 Adding styles to discogs plugin 2019-05-05 11:11:27 +02:00
Carl Suster
ca60555ffa Fix deprecated call log.warn -> log.warning
https://bugs.python.org/issue13235
2019-03-31 19:44:40 +11:00
Adrian Sampson
f54042f194 Make a comment into a full sentence 2019-02-08 18:18:30 -08:00
jan
5ace667757 add forgotten request_finished 2019-02-08 01:09:07 +01:00
jan
9bc3898951 add request_finished function, rename wait_for_rate_limiter to request_start, add doc and changelog 2019-02-08 01:02:33 +01:00
jan
77fd5ee548 keep discogs requests below rate limit 2019-02-08 00:05:07 +01:00
Jack Wilsdon
768770d561
Fix incorrect indentation 2019-01-31 00:15:42 +00:00
Dmitry Bogdanov
a840bc700b
Merge branch 'master' into discogs_original_year 2018-05-02 17:41:07 +02:00
Jérémie Detrey
9f4c5c8096 Do not rely on positional arguments for TrackInfo. 2018-04-30 18:37:27 +02:00
Dmitry Bogdanov
6aba118e94 Fetch original_year from master releases for Discogs (#1122)
This adds an additional Discogs API call inside get_album_info().
Assume that original_year equals to year for releases without a
master release.
2018-04-29 18:18:15 +02:00
Dmitry Bogdanov
f9b6473893 Some more code style fixes 2018-04-28 19:03:32 +02:00
Dmitry Bogdanov
7ac2aff50c Fix a few code style issues 2018-04-28 14:06:29 +02:00
Dmitry Bogdanov
0ea5882bc0 Better comments in code explaining Discogs track IDs (#2336) 2018-04-28 02:32:42 +02:00
Dmitry Bogdanov
09ee194142 Make Discogs medium indexing code easier to understand 2018-04-28 02:23:46 +02:00
Dmitry Bogdanov
48140f11e7 Use releasegroup_id to store master release IDs from Discogs
Master releases roughly correspond to MusicBrainz' release groups.
It will be usefull to store master IDs, for example to retrieve
original release dates (#1122).
2018-04-27 21:56:51 +02:00
Dmitry Bogdanov
2e422122b3 Invent our own track IDs for Discogs
Discogs does not provide track IDs. As a workaround, invent our own
IDs by combining release ID with original track position strings
returned by Discogs (#2336).
2018-04-27 20:30:35 +02:00
Dmitry Bogdanov
676536efa7 Fix incorrect indexing of two-sided mediums
Fix incorrect split of a tracklist by medium for the case of
two-sided mediums (#2887).

Following the discussion in #2887, the 'medium_total' value should
contain the number of tracks on the medium to which each particular
track belongs, not the total number of different mediums present on
a release.

Fix unit tests accordingly.
2018-04-27 19:28:35 +02:00
Adrian Sampson
74c0e0d6e9 Fix default for user_token
Always match the expected type.
2017-02-21 13:56:20 -05:00
Adrian Sampson
a29b29f533 Docs improvements for #2447 2017-02-21 09:49:22 -05:00
Robin H. Johnson
3e4c9b8c06
discogs: support simple auth.
The official OAuth authentication seems to have broken, so allow usage
of simple configuration instead.

See-Also: https://github.com/discogs/discogs_client/issues/78
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2017-02-20 20:20:20 -08:00
Mike Cameron
c58c49d77f Fixed trailing whitespace issue. Changed alternate track property name. 2017-01-10 18:39:01 -05:00
Mike Cameron
8a00791ecc Oops. Forgot to actually stage the correct file. 2017-01-01 04:52:32 -05:00
Diego M. Rodriguez
3f36f67940
discogs: tweak pruning of empty candidate albums 2016-12-30 11:39:19 +01:00
Diego M. Rodriguez
37cb1c295f
Merge remote-tracking branch 'upstream/master' into discogs-relax-assumptions
Conflicts:
	docs/changelog.rst
	test/test_discogs.py
2016-12-30 10:42:50 +01:00
Diego M. Rodriguez
072e6de3ae
discogs: add changelog for #2318, fix typo 2016-12-30 10:17:53 +01:00
Diego M. Rodriguez
0a9cb1fd3d
discogs: revise subtrack merging based on subindex
Modify the coalescing of subtracks by taking into account the subindices
of the subtracks for deciding if they represent "logical" tracks
(merging them into one single track, as previously) or if they represent
physical tracks (treating them as individual tracks).
Add unit tests for nested logical/physical subtracks, and disc titles.
2016-12-29 18:03:54 +01:00
Diego M. Rodriguez
30f238151e
discogs: additional sanity checks parsing release
Add extra checks for the presence of specific field (artists, title,
id, tracklist) when parsing a Release from discogs, failing gracefully
if the fields could not be found.
Add a test for releases without required fields.
2016-12-29 13:19:01 +01:00
Diego M. Rodriguez
02666424d4
discogs: improve robustness when parsing an album
Improve the robustness of `get_album_info()` by preferring the use of
`get()` over accesing the dictionary keys directly for several fields,
plus adding extra checks for fields that depend on nested containers on
the Release data.
Add a test for parsing a release that contains a minimal amount of
fields.
2016-12-28 21:07:18 +01:00
Johnny Robeson
bca6d2af01 Remove requests/urllib3 logging override in discogs
Discog plugin overrides the global logging for `requests` for a reason
that seems no longer valid.

I can't seem to reproduce the logging behavior mentioned in the
preceding comment, so I'm removing it.

If we do want to modify `requests` logging in the future, then we should
hook it into beets verbose logging.
2016-12-09 00:52:24 -05:00
kooimens
373cf19f8b Fix discogs disc field is set to zero
Fixes #587. The disc field is only zero when there is only one medium, so I think this will do the trick. I wasn't able to reproduce the real problem within the code. This is just a small workaround.
2016-10-17 19:51:03 +02:00
Diego Moreda
1f4bef9e61 discogs: docstring style fix 2016-10-10 20:30:21 +02:00
Diego Moreda
f4907ca5d0 discogs: handle nested subtracks, add try block
Modify coalesce_tracks() in order to handle the case where subtracks
are defined inside an index track (as `sub_tracks` attribute),
reorganizing the if logic to avoid duplicated code.

Add a try..catch block enclosing the call to clean_tracklist, as a
measure for avoiding side effects (and reverting to just parsing the
raw_list if there are any problems).
2016-10-10 19:59:42 +02:00
Diego Moreda
fb398c5f2c discogs: add medium_total to tracks (#415) 2016-10-10 17:46:41 +02:00