chore: cleaner urls
This commit is contained in:
parent
ec8af1873f
commit
0b188286ea
15 changed files with 25 additions and 25 deletions
|
@ -38,7 +38,7 @@ export const buildChart = (tracks, artists, albums, nowPlaying = {}) => {
|
|||
/\s+/g,
|
||||
'+'
|
||||
)}&type=artist`,
|
||||
image: artists[artistSanitizedKey(track['artist'])]?.['image'] || `https://coryd.dev/.netlify/images/?url=https://f001.backblazeb2.com/file/coryd-dev-images/artists/${sanitizeMediaString(track['artist']).replace(/\s+/g, '-').toLowerCase()}.jpg&fit=cover&w=320&h=320`,
|
||||
image: artists[artistSanitizedKey(track['artist'])]?.['image'] || `https://coryd.dev/.netlify/images/?url=/media/artists/${sanitizeMediaString(track['artist']).replace(/\s+/g, '-').toLowerCase()}.jpg&fit=cover&w=320&h=320`,
|
||||
type: 'artist'
|
||||
}
|
||||
} else {
|
||||
|
@ -52,7 +52,7 @@ export const buildChart = (tracks, artists, albums, nowPlaying = {}) => {
|
|||
plays: 1,
|
||||
mbid: albums[albumSanitizedKey(track['album'])]?.['mbid'] || '',
|
||||
url: (albums[albumSanitizedKey(track['album'])]?.['mbid'] && albums[albumSanitizedKey(track['album'])]?.['mbid'] !== '') ? `https://musicbrainz.org/release-group/${albums[albumSanitizedKey(track['album'])]?.['mbid']}` : `https://musicbrainz.org/taglookup/index?tag-lookup.artist=${track['artist'].replace(/\s+/g, '+')}&tag-lookup.release=${track['album'].replace(/\s+/g, '+')}`,
|
||||
image: albums[albumSanitizedKey(track['album'])]?.['image'] || `https://coryd.dev/.netlify/images/?url=https://f001.backblazeb2.com/file/coryd-dev-images/albums/${sanitizeMediaString(track['artist']).replace(/\s+/g, '-').toLowerCase()}-${sanitizeMediaString(track['album'].replace(/[:\/\\,'']+/g
|
||||
image: albums[albumSanitizedKey(track['album'])]?.['image'] || `https://coryd.dev/.netlify/images/?url=/media/albums/${sanitizeMediaString(track['artist']).replace(/\s+/g, '-').toLowerCase()}-${sanitizeMediaString(track['album'].replace(/[:\/\\,'']+/g
|
||||
, '').replace(/\s+/g, '-').toLowerCase())}.jpg&fit=cover&w=320&h=320`,
|
||||
type: 'album'
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ export const buildChart = (tracks, artists, albums, nowPlaying = {}) => {
|
|||
|
||||
export const buildTracksWithArt = (tracks, artists, albums) => {
|
||||
tracks.forEach(track => {
|
||||
track['image'] = albums[albumSanitizedKey(track['album'])]?.['image'] || `https://coryd.dev/.netlify/images/?url=https://f001.backblazeb2.com/file/coryd-dev-images/albums/${sanitizeMediaString(track['artist']).replace(/\s+/g, '-').toLowerCase()}-${sanitizeMediaString(track['album'].replace(/[:\/\\,'']+/g
|
||||
track['image'] = albums[albumSanitizedKey(track['album'])]?.['image'] || `https://coryd.dev/.netlify/images/?url=/media/albums/${sanitizeMediaString(track['artist']).replace(/\s+/g, '-').toLowerCase()}-${sanitizeMediaString(track['album'].replace(/[:\/\\,'']+/g
|
||||
, '').replace(/\s+/g, '-').toLowerCase())}.jpg&fit=cover&w=320&h=320`
|
||||
track['url'] = (artists[artistSanitizedKey(track['artist'])]?.['mbid'] && artists[artistSanitizedKey(track['artist'])]?.['mbid'] !== '') ? `http://musicbrainz.org/artist/${artists[artistSanitizedKey(track['artist'])]?.['mbid']}` : `https://musicbrainz.org/search?query=${track['artist'].replace(
|
||||
/\s+/g,
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -41,56 +41,56 @@ export default {
|
|||
{
|
||||
title: 'the whaler',
|
||||
artist: 'home is where',
|
||||
image: 'https://coryd.dev/.netlify/images/?url=https://f001.backblazeb2.com/file/coryd-dev-images/albums/home-is-where-the-whaler.jpg&fit=cover&w=320&h=320',
|
||||
image: 'https://coryd.dev/.netlify/images/?url=/media/albums/home-is-where-the-whaler.jpg&fit=cover&w=320&h=320',
|
||||
url: 'https://musicbrainz.org/release-group/6fe3516f-c324-4265-8f43-d902f3a4cc20',
|
||||
type: 'album',
|
||||
},
|
||||
{
|
||||
title: 'The Enduring Spirit',
|
||||
artist: 'Tomb Mold',
|
||||
image: 'https://coryd.dev/.netlify/images/?url=https://f001.backblazeb2.com/file/coryd-dev-images/albums/tomb-mold-the-enduring-spirit.jpg&fit=cover&w=320&h=320',
|
||||
image: 'https://coryd.dev/.netlify/images/?url=/media/albums/tomb-mold-the-enduring-spirit.jpg&fit=cover&w=320&h=320',
|
||||
url: 'https://musicbrainz.org/release-group/cd3e5dfb-acca-4856-80f6-2e095ac3270d',
|
||||
type: 'album',
|
||||
},
|
||||
{
|
||||
title: 'A Dialogue With The Eeriest Sublime',
|
||||
artist: 'Vertebra Atlantis',
|
||||
image: 'https://coryd.dev/.netlify/images/?url=https://f001.backblazeb2.com/file/coryd-dev-images/albums/vertebra-atlantis-a-dialogue-with-the-eeriest-sublime.jpg&fit=cover&w=320&h=320',
|
||||
image: 'https://coryd.dev/.netlify/images/?url=/media/albums/vertebra-atlantis-a-dialogue-with-the-eeriest-sublime.jpg&fit=cover&w=320&h=320',
|
||||
url: 'https://musicbrainz.org/release-group/b8f1913b-f461-443c-a26c-377b259f2af6',
|
||||
type: 'album',
|
||||
},
|
||||
{
|
||||
title: 'ONE MORE TIME...',
|
||||
artist: 'blink-182',
|
||||
image: 'https://coryd.dev/.netlify/images/?url=https://f001.backblazeb2.com/file/coryd-dev-images/albums/blink-182-one-more-time.jpg&fit=cover&w=320&h=320',
|
||||
image: 'https://coryd.dev/.netlify/images/?url=/media/albums/blink-182-one-more-time.jpg&fit=cover&w=320&h=320',
|
||||
url: 'https://musicbrainz.org/release-group/520d6d45-19c8-4ee1-a954-180e7902f3da',
|
||||
type: 'album',
|
||||
},
|
||||
{
|
||||
title: 'Life Like',
|
||||
artist: 'Dead Bob',
|
||||
image: 'https://coryd.dev/.netlify/images/?url=https://f001.backblazeb2.com/file/coryd-dev-images/albums/dead-bob-life-like.jpg&fit=cover&w=320&h=320',
|
||||
image: 'https://coryd.dev/.netlify/images/?url=/media/albums/dead-bob-life-like.jpg&fit=cover&w=320&h=320',
|
||||
url: 'https://musicbrainz.org/release-group/ab53e625-74af-4a09-a8ff-e1c08dbae596',
|
||||
type: 'album',
|
||||
},
|
||||
{
|
||||
title: 'Threads of Unknowing',
|
||||
artist: 'VoidCeremony',
|
||||
image: 'https://coryd.dev/.netlify/images/?url=https://f001.backblazeb2.com/file/coryd-dev-images/albums/voidceremony-threads-of-unknowing.jpg&fit=cover&w=320&h=320',
|
||||
image: 'https://coryd.dev/.netlify/images/?url=/media/albums/voidceremony-threads-of-unknowing.jpg&fit=cover&w=320&h=320',
|
||||
url: 'https://musicbrainz.org/release-group/f1f91cde-ff57-41c8-bd58-28c236b3f0c6',
|
||||
type: 'album',
|
||||
},
|
||||
{
|
||||
title: 'Why Would I Watch',
|
||||
artist: 'Hot Mulligan',
|
||||
image: 'https://coryd.dev/.netlify/images/?url=https://f001.backblazeb2.com/file/coryd-dev-images/albums/hot-mulligan-why-would-i-watch.jpg&fit=cover&w=320&h=320',
|
||||
image: 'https://coryd.dev/.netlify/images/?url=/media/albums/hot-mulligan-why-would-i-watch.jpg&fit=cover&w=320&h=320',
|
||||
url: 'https://musicbrainz.org/release-group/5afd31ea-3a96-4b99-a477-4d121efaedec',
|
||||
type: 'album',
|
||||
},
|
||||
{
|
||||
title: 'Losing What We Love',
|
||||
artist: 'Knuckle Puck',
|
||||
image: 'https://coryd.dev/.netlify/images/?url=https://f001.backblazeb2.com/file/coryd-dev-images/albums/knuckle-puck-losing-what-we-love.jpg&fit=cover&w=320&h=320',
|
||||
image: 'https://coryd.dev/.netlify/images/?url=/media/albums/knuckle-puck-losing-what-we-love.jpg&fit=cover&w=320&h=320',
|
||||
url: 'https://musicbrainz.org/release-group/b51d8882-3854-400a-b79b-4353a77a389b',
|
||||
type: 'album',
|
||||
}
|
||||
|
|
Reference in a new issue