mirror of
https://github.com/murdos/musicbrainz-userscripts
synced 2024-11-14 23:07:09 +00:00
[bandcamp] Add Bandcamp URLs to the release editor.
This commit is contained in:
parent
94839e507e
commit
d511817a4d
1 changed files with 22 additions and 0 deletions
|
@ -70,6 +70,28 @@ function retrieveReleaseInfo() {
|
|||
disc.tracks.push(track);
|
||||
});
|
||||
|
||||
// URLs
|
||||
// link_type mapping:
|
||||
// - 74: purchase for download
|
||||
// - 75: download for free
|
||||
// - 85: stream {video} for free
|
||||
release.urls = new Array();
|
||||
// Download for free vs. for purchase
|
||||
if (bandcampAlbumData.current.download_pref !== null) {
|
||||
if (bandcampAlbumData.current.minimum_price_nonzero === null ||
|
||||
bandcampAlbumData.current.minimum_price == 0.0) {
|
||||
release.urls.push( { 'url': window.location.href, 'link_type': 75 } );
|
||||
}
|
||||
if (bandcampAlbumData.current.minimum_price_nonzero !== null &&
|
||||
bandcampAlbumData.current.minimum_price > 0.0) {
|
||||
release.urls.push( { 'url': window.location.href, 'link_type': 74 } );
|
||||
}
|
||||
}
|
||||
// Check if the release is streamable
|
||||
if (bandcampAlbumData.hasAudio) {
|
||||
release.urls.push( { 'url': window.location.href, 'link_type': 85 } );
|
||||
}
|
||||
|
||||
mylog(release);
|
||||
return release;
|
||||
|
||||
|
|
Loading…
Reference in a new issue