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:
Brian Beck 2018-08-10 18:56:16 -07:00 committed by GitHub
parent e696ffc70e
commit d3bb6d2484
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 7 deletions

View file

@ -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 || [],

View file

@ -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 => {