Skip to content
This repository has been archived by the owner on Jun 2, 2020. It is now read-only.

incorrect tracklist for versions with more than one side CD #105

Closed
ExperimentalHypothesis opened this issue Mar 14, 2020 · 5 comments
Closed

Comments

@ExperimentalHypothesis
Copy link

let us say i want to get a tracklist of this version of a release - https://www.discogs.com/Edward-Ka-Spel-Dream-Logik-Part-Two/master/277838 - works fine because it has only one side

but

let us say i want to get a tracklist of this version of a release which is double side LTD - https://www.discogs.com/Edward-Ka-Spel-Dream-Logik-Part-Two/release/1425757

it returns a buggy list with two more strings which ARE NOT TRACKS but names of each side.

@ExperimentalHypothesis ExperimentalHypothesis changed the title incorrect tracklist for LTD version with more than one side CD incorrect tracklist for versions with more than one side CD Mar 14, 2020
@Kalli
Copy link

Kalli commented Mar 17, 2020

Those tracks are headings and should be indicated as such in the api response if you take a look at the track data.

For instance this code:

release = discogs_client.release(1425757)
for track in release.tracklist:
    print(track.title, track.data.get('type_', None))

Should print something like:

(u'Dream Logik Part Two', u'heading')
(u'As A Bird / A Missing Piece', u'track')
(u'Darkness O', u'track')
(u'The Modest Ambitions Of Cedric The Centipede', u'track')
(u'Under The Junction', u'track')
(u'Going My Way?', u'track')
(u"New Fool's Moon / The Closet", u'track')
(u'My Wandering Star / As A Bird (Part 2)', u'track')
(u'Burning Church', u'heading')
(u'Burning Church (Version Hot)', u'track')

You should be able to filter out the kinds of tracks you are looking from based on the data attribute of each track in the tracklist. More info about track types:
https://support.discogs.com/hc/en-us/articles/360005055373-Database-Guidelines-12-Tracklisting#Index_Tracks_And_Headings

@ExperimentalHypothesis
Copy link
Author

ExperimentalHypothesis commented Mar 17, 2020 via email

@Kalli
Copy link

Kalli commented Mar 17, 2020

No problem and you are right, it could probably be documented a bit better. Closing this issue since that seems like the proposed solution will do the job for you.

@Kalli Kalli closed this as completed Mar 17, 2020
@ExperimentalHypothesis
Copy link
Author

ExperimentalHypothesis commented Mar 17, 2020 via email

@Kalli
Copy link

Kalli commented Mar 18, 2020

Yeah, that I can see how that could be confusing. Haven't dug into it but think it might be because the search returns different objects than the release itself (see https://github.com/discogs/discogs_client/blob/master/discogs_client/models.py#L421)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants