mirror of
https://github.com/BradNut/graphbrainz
synced 2025-09-08 17:40:32 +00:00
Automatically fix some invalid/incomplete musicVideo URLs, return empty arrays instead of null for empty fanart.tv image lists (#73)
This commit is contained in:
parent
e696ffc70e
commit
d3bb6d2484
2 changed files with 15 additions and 7 deletions
|
|
@ -22,23 +22,23 @@ export default {
|
||||||
},
|
},
|
||||||
FanArtArtist: {
|
FanArtArtist: {
|
||||||
backgrounds: artist => {
|
backgrounds: artist => {
|
||||||
return artist.artistbackground
|
return artist.artistbackground || []
|
||||||
},
|
},
|
||||||
thumbnails: artist => {
|
thumbnails: artist => {
|
||||||
return artist.artistthumb
|
return artist.artistthumb || []
|
||||||
},
|
},
|
||||||
logos: artist => {
|
logos: artist => {
|
||||||
return artist.musiclogo
|
return artist.musiclogo || []
|
||||||
},
|
},
|
||||||
logosHD: artist => {
|
logosHD: artist => {
|
||||||
return artist.hdmusiclogo
|
return artist.hdmusiclogo || []
|
||||||
},
|
},
|
||||||
banners: artist => {
|
banners: artist => {
|
||||||
return artist.musicbanner
|
return artist.musicbanner || []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
FanArtLabel: {
|
FanArtLabel: {
|
||||||
logos: label => label.musiclabel
|
logos: label => label.musiclabel || []
|
||||||
},
|
},
|
||||||
FanArtAlbum: {
|
FanArtAlbum: {
|
||||||
albumCovers: album => album.albumcover || [],
|
albumCovers: album => album.albumcover || [],
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,15 @@ export default {
|
||||||
theme: track => track.strTheme || null
|
theme: track => track.strTheme || null
|
||||||
},
|
},
|
||||||
TheAudioDBMusicVideo: {
|
TheAudioDBMusicVideo: {
|
||||||
url: track => track.strMusicVid || null,
|
url: track => {
|
||||||
|
let url = track.strMusicVid || null
|
||||||
|
// Many of these are missing the protocol and start with www, so add it
|
||||||
|
// in that case.
|
||||||
|
if (url && url.startsWith('www.')) {
|
||||||
|
url = `https://${url}`
|
||||||
|
}
|
||||||
|
return url
|
||||||
|
},
|
||||||
companyName: track => track.strMusicVidCompany || null,
|
companyName: track => track.strMusicVidCompany || null,
|
||||||
directorName: track => track.strMusicVidDirector || null,
|
directorName: track => track.strMusicVidDirector || null,
|
||||||
screenshots: handleImageSize(track => {
|
screenshots: handleImageSize(track => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue