Commit graph

124 commits

Author SHA1 Message Date
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
Diego Moreda
1148acaaf1 discogs: revise position regexp, add tests, tox
Revise the regular expression used for extracting information from a
discogs position, making the subtrack_index only be matched if one of
the other groups is matched as well. Split the definition into several
lines in order to try to document it a bit more clearly.
Add unit tests for position parsing and non standard positions.
Fix the underscore on tox dependency.
2016-10-10 17:42:27 +02:00
Diego Moreda
e7f2a111e4 discogs: add test dependencies, fix spelling 2016-10-09 17:57:36 +02:00
Diego Moreda
be223d966e discogs: coalesce subtracks (#1543)
Detect subtracks and merge them into a single track, taking into account
the index tracks if present. This includes a revision of the regular
expression used for converting a discogs "position" into medium, medium
index and subtrack index pieces, following the standard discogs
positions (12.2.9).
2016-10-07 19:09:09 +02:00
Diego Moreda
c55885c9e8 discogs: take into account two-sided media (#1762)
Revise the discogs plugin so two-sided mediums are taking into account
and each pair of consecutive *sides* is treated as single *medium*.
2016-10-07 19:01:50 +02:00
Diego Moreda
911117ef49 discogs: set media on tracks (#1921)
Set the media for all the tracks when fetching a release using discogs,
as autotag.apply_metadata requires it in order to work properly.
2016-10-06 19:49:43 +02:00
Johnny Robeson
6b73aa25d2 Use b'' in discogs medium query regex
Since the first arg to `re.sub()` is bytes, thus must be the
replacement string.
2016-09-20 17:38:39 -04:00
arogl
86d2129c52 Spelling update 2016-08-12 14:48:55 +10:00
Adrian Sampson
5efd5b21c5 Use new as_str method
Instead of `get(six.text_type)`, which was a surprisingly large portion of our
uses of six.
2016-06-25 19:16:14 -07:00
Johnny Robeson
e8afcbe7ec replace unicode with six.text_type 2016-06-24 05:53:49 -04:00
Johnny Robeson
7713be4c0f use http_client (really http.client) from six.moves 2016-06-23 04:40:18 -04:00
Johnny Robeson
5e62b39f75 replace TEMPORARY with FIXME in discogs plugin
We're more likely to search for this later by FIXME.

NOTE: the bug is fixed, but the versions with the fix may not be widely
distributed yet
2016-06-10 02:30:00 -04:00
Johnny Robeson
5485bdb706 add missing b' in discogs query regex 2016-06-10 02:23:14 -04:00
Adrian Sampson
e54c7eec3d Standardize __future__ imports without parentheses
Since the list is short enough now, we don't need parentheses for the line
wrap. This is a little less ugly.
2016-02-28 15:03:51 -08:00
Peter Kessen
40900aa1cb Removed unicode_literals from plugins
* bucket
* chroma
* convert
* discogs
2016-02-20 12:10:01 +01:00
Adrian Sampson
c7045daf90 sampsyo -> beetbox (#1730) 🎉 2016-01-08 20:36:16 -08:00
Adrian Sampson
0301bb517d Update links for our new domain 2016-01-08 16:26:13 -08:00
Jack Wilsdon
12cd5306b7 Update copyright dates to 2016 2015-12-30 15:42:06 +00:00
Peter Kessen
3eb8008b11 added encoding as comment in files
added line like
# -*- coding: utf-8 -*-
to all files with correct license in header
2015-11-19 18:41:01 +01:00
Adrian Sampson
9165b7cf45 Trailing comma (#1708) 2015-11-08 13:02:07 -08:00