Support standalone Bandcamp tracks#7
Conversation
| throw new ProviderError(this.provider.name, `${specifier} is not a release URL`); | ||
| } | ||
| this.lookup = { method: 'id', value: entity.id }; | ||
| this.id = entity.id; |
There was a problem hiding this comment.
I assigned the id here so that I could access it in getRawRelease. Is the assignment in convertRawRelease still needed?
There was a problem hiding this comment.
I don't think so, no idea why I haven't made this assignment in the constructor right from the start 😇
Looks like this is worth to be changed in all provider implementations.
a9a1c11 to
6f4dead
Compare
kellnerd
left a comment
There was a problem hiding this comment.
Thank you! I am surprised how few changes are necessary to support seeding releases for track pages as well.
| throw new ProviderError(this.provider.name, `${specifier} is not a release URL`); | ||
| } | ||
| this.lookup = { method: 'id', value: entity.id }; | ||
| this.id = entity.id; |
There was a problem hiding this comment.
I don't think so, no idea why I haven't made this assignment in the constructor right from the start 😇
Looks like this is worth to be changed in all provider implementations.
bea9be8 to
3c799be
Compare
kellnerd
left a comment
There was a problem hiding this comment.
LGTM, just a final round of minor nitpicks 🧐
Some `/track/` URLs on Bandcamp represent singles (often with their own cover art) that aren't otherwise released as part of an album. It seems you can distinguish these from album tracks by checking `TrAlbumCurrent.album_id`, which is `null` for tracks without an associated album. (Perhaps there is another, more obvious way that I missed.)
Bandcamp `/track/` URLs may include an ISRC in `TrAlbumCurrent`.
Handle `null` and missing values for release date, GTIN and track number.
The original thought was not to seed edit notes with localhost URLs, but this can also happen with a local production server, not only with a development server. It is rather useful being able to check the permalinks in development.
Some
/track/URLs on Bandcamp represent singles (often with their own cover art) that aren't otherwise released as part of an album.It seems you can distinguish these from album tracks by checking
TrAlbumCurrent.album_id, which isnullfor tracks without an associated album. (Perhaps there is another, more obvious way that I missed.)In the second commit, I was able to extract an ISRC for these tracks where available. (Apparently Bandcamp only embeds ISRCs on track pages, not album pages?)
This is probably very hacky since I was still trying to wrap my head around the codebase, but I'm happy to improve it.
A few URLs I tested with: