Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discogs: fetch original release year/date #1122

Open
ghost opened this issue Nov 29, 2014 · 9 comments
Open

Discogs: fetch original release year/date #1122

ghost opened this issue Nov 29, 2014 · 9 comments
Labels
feature features we would like to implement

Comments

@ghost
Copy link

ghost commented Nov 29, 2014

The Discogs plugin currently doesn't seem to fetch the original release year of an album, for instance this 1984 release of a 1972 album returns the 'year' as 1984 (which is correct) and the 'original_year' of 0000 (not correct, obviously :D)

@sampsyo sampsyo added the feature features we would like to implement label Nov 29, 2014
@sampsyo
Copy link
Member

sampsyo commented Nov 29, 2014

Thanks! See also #465.

If anyone has some time to devote to this, it would be very helpful to know where the original date appears (if at all) in discogs responses. Just take a look at some API result and look around for the info we need.

@elwoodpd
Copy link

elwoodpd commented Dec 1, 2014

The problem is that the 'year; attribute is not returned reliably. Especially for editions that don't have a release date either. It also sometimes seems to be set to the year the edition was released.

Seems like the right way to do this would be query the Master Release for which master_url should be provided when you query a release. Then take the year from that which should be the original date (or at least the earliest date for which discogs knows of a release) and also should be returned more reliably. Only if that fails take the year attribute of the specific release.

Only thing a little weird is in the api documentation they say 'Masters have a “main release” which is often the chronologically earliest.' Often doesn't really seem strong enough for what is wanted here. Not quite sure what caused that them to say it like that.

I guess what could be done is query /masters/{master_id}/versions which gives all versions of the same release and then loop through and choose the earliest date but that seems a bit crazy especially as it might require dealing with pagination.

I don't know how many hits on the api is acceptable.

@dbogdanov
Copy link
Contributor

dbogdanov commented Apr 14, 2018

I think the "main release" date would work well. In my experience it always coincides with the original release. No pagination necessary, and it's better than nothing.

dbogdanov added a commit to dbogdanov/beets that referenced this issue Apr 27, 2018
Master releases roughly correspond to MusicBrainz' release groups.
It will be usefull to store master IDs, for example to retrieve
original release dates (beetbox#1122).
@dbogdanov
Copy link
Contributor

I think the "main release" date would work well. In my experience it always coincides with the original release. No pagination necessary, and it's better than nothing.

I can implement this in my pull request if you confirm that this is a good solution.

@sampsyo
Copy link
Member

sampsyo commented Apr 27, 2018

Sounds good, but could you use a separate PR? It's nice to be able to review one fix/improvement at a time.

dbogdanov added a commit to dbogdanov/beets that referenced this issue Apr 29, 2018
This adds an additional Discogs API call inside get_album_info().
Assume that original_year equals to year for releases without a
master release.
sampsyo added a commit that referenced this issue May 2, 2018
Fetch original_year from master releases for Discogs (#1122)
@lbesnard
Copy link

lbesnard commented Jun 6, 2018

Any suggestion as the cleanest way to re-import those albums (with v 1.4.7) already in the beet database and moving their path accordingly to the beet config

paths:                                                                                                                                                                                                                                    
      default: '%title{$genre}/%the{%title{$albumartist}}/$original_year - $album/%if{$multidisc,Disc $disc/}$track $title'

cheers !

@sampsyo
Copy link
Member

sampsyo commented Jun 6, 2018

@lbesnard
Copy link

lbesnard commented Jun 6, 2018

thanks a lot @sampsyo (and sorry for that)

@lbesnard
Copy link

lbesnard commented Jun 6, 2018

actually for reference (for someone else), the best way to re-import (which does the move automatically) for this specific issue was to do

beet import -L -a original_year:0000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature features we would like to implement
Projects
None yet
Development

No branches or pull requests

4 participants