salcido / discogs-enhancer

100% vanilla JS Chrome extension that adds useful features and functionality to Discogs.com
https://www.discogs-enhancer.com
GNU General Public License v3.0
105 stars 15 forks source link

Feature Request: Original Year on Artist Pages #277

Open tsnavi opened 2 months ago

tsnavi commented 2 months ago

The new Discogs UI shows the latest release (often a reissue) instead of the Original Year of the first release on Artist pages. This newest release then becomes the default 'Year' used when sorting by Year, which makes it difficult to pinpoint the chronological order of original works.

Example: image

From what I can gather, the 'original release' information is returned in the API Request Response after clicking the 'more versions' buttons under the releases. Here's an example (note: under releaseGroupDetails[0] there is a 'released' parameter which correctly shows 1997.

data : {artist: {discogsId: 59373,…}} artist : {discogsId: 59373,…} discogsId : 59373 releases : {releaseGroupDetails: [{,…}, {,…}, {,…}, {,…}, {,…}], __typename: "ArtistCreditsConnection"} releaseGroupDetails : [{,…}, {,…}, {,…}, {,…}, {,…}] 0 : {,…} release : {discogsId: 2663040, title: "Idle Worship", dataQuality: "NEW_SUBMISSION", visibility: "PUBLIC",…} collectionItems : null country : "US" dataQuality : "NEW_SUBMISSION" discogsId : 2663040 formats : [{name: "CD", quantity: "1", description: ["Album"], text: null, __typename: "Format"}] inWantlist : null labelsNew : [{catalogNumber: "JUMP 010", labelRole: "LABEL", displayName: "Jump Up! Records",…}] masterRelease : {discogsId: 303145, __typename: "MasterRelease"} myListings : {totalCount: 0, __typename: "InventoryItemConnection"} released : "1997" siteUrl : "/release/2663040-The-Eclectics-Idle-Worship" title : "Idle Worship" visibility : "PUBLIC" __typename : "Release" __typename : "ArtistCredit" 1 : {,…} 2 : {,…} 3 : {,…} 4 : {,…} __typename : "ArtistCreditsConnection" __typename : "Artist"

I'm probably barking up the wrong tree here, but I would like this functionality back from Discogs, and judging from their forum posts about this issue, they don't appear to be that fussed about returning it. Perhaps you'd be interested in having a go, or you could point me in the right direction towards a solution (perhaps something that would fit into discogs-enhancer once completed).

salcido commented 2 months ago

@tsnavi Hey, sorry for the delay in getting back to you on this. I've been away on vacation for the last week.

I'll take a look at this but my gut feeling is there is not a fast / easy way to do this. I think because the MR data needs to be fetched for each MR, the extension would need to iterate over all the releases and make a request for each one, and then update the DOM with the actual release date.

That will make things slow because Discogs limits the number of requests you can make to 1 per second or 60 in a minute. If you're looking at an artist page with lots of MR, it could take several minutes to fire off every request. I hope that makes sense.

tsnavi commented 2 months ago

No worries, hope you had a good time! Yeah, that makes sense. After making the feature request I started digging into the Discogs API myself and managed to make a really rough version using Flask. I will upload a working version of it once I've knocked it into shape.

I'm currently stuck on getting Discogs API to provide a specific 'role' or 'credit' a person has on a record, it seems to like calling things 'Appearance' when they're not, probably because I'm asking the wrong question... image

tsnavi commented 2 months ago

Dead rough, but here's a working demo: https://github.com/tsnavi/albinij/

https://tsnavi.pythonanywhere.com/