feat: cdn cutover
This commit is contained in:
parent
57bd614e5d
commit
979d895f33
20 changed files with 43 additions and 67 deletions
|
@ -36,10 +36,7 @@ export default async function () {
|
|||
if (!data[i]) {
|
||||
data.push({ title: titles[i]?.textContent })
|
||||
data.push({ author: authors[i]?.textContent })
|
||||
data.push({ image: images[i].src.replace(
|
||||
'https://cdn.thestorygraph.com',
|
||||
'https://cd-books.b-cdn.net'
|
||||
),
|
||||
data.push({ image: `https://coryd.dev/.netlify/images/?url=${images[i]?.src}&fit=cover&w=200&h=307`,
|
||||
})
|
||||
data.push({ url: `https://app.thestorygraph.com${urls[i].href}` })
|
||||
data.push({ percentage: percentages[i]?.textContent })
|
||||
|
@ -52,10 +49,7 @@ export default async function () {
|
|||
if (data[i]) {
|
||||
data[i]['title'] = titles[i]?.textContent
|
||||
data[i]['author'] = authors[i]?.textContent
|
||||
data[i]['image'] = images[i]?.src.replace(
|
||||
'https://cdn.thestorygraph.com',
|
||||
'https://cd-books.b-cdn.net'
|
||||
),
|
||||
data[i]['image'] = `https://coryd.dev/.netlify/images/?url=${images[i]?.src}&fit=cover&w=200&h=307`,
|
||||
data[i]['url'] = `https://app.thestorygraph.com${urls[i]?.href}`
|
||||
data[i]['percentage'] = percentages[i]?.textContent
|
||||
data[i]['dateAdded'] = date
|
||||
|
|
|
@ -38,7 +38,7 @@ export const buildChart = (tracks, artists, albums, nowPlaying = {}) => {
|
|||
/\s+/g,
|
||||
'+'
|
||||
)}&type=artist`,
|
||||
image: artists[artistSanitizedKey(track['artist'])]?.['image'] || `https://cdn.coryd.dev/artists/${sanitizeMediaString(track['artist']).replace(/\s+/g, '-').toLowerCase()}.jpg`,
|
||||
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`,
|
||||
type: 'artist'
|
||||
}
|
||||
} else {
|
||||
|
@ -52,8 +52,8 @@ 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://cdn.coryd.dev/albums/${sanitizeMediaString(track['artist']).replace(/\s+/g, '-').toLowerCase()}-${sanitizeMediaString(track['album'].replace(/[:\/\\,'']+/g
|
||||
, '').replace(/\s+/g, '-').toLowerCase())}.jpg`,
|
||||
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
|
||||
, '').replace(/\s+/g, '-').toLowerCase())}.jpg&fit=cover&w=320&h=320`,
|
||||
type: 'album'
|
||||
}
|
||||
} else {
|
||||
|
@ -78,8 +78,8 @@ export const buildChart = (tracks, artists, albums, nowPlaying = {}) => {
|
|||
|
||||
export const buildTracksWithArt = (tracks, artists, albums) => {
|
||||
tracks.forEach(track => {
|
||||
track['image'] = albums[albumSanitizedKey(track['album'])]?.['image'] || `https://cdn.coryd.dev/albums/${sanitizeMediaString(track['artist']).replace(/\s+/g, '-').toLowerCase()}-${sanitizeMediaString(track['album'].replace(/[:\/\\,'']+/g
|
||||
, '').replace(/\s+/g, '-').toLowerCase())}.jpg`
|
||||
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
|
||||
, '').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
|
@ -3,37 +3,37 @@ export default {
|
|||
{
|
||||
alt: 'Stay True',
|
||||
author: 'Hua Hsu',
|
||||
image: 'https://cd-books.b-cdn.net/8jdewx4ipwb9hro2oedjkfj1cy0f',
|
||||
image: 'https://coryd.dev/.netlify/images/?url=https://cdn.thestorygraph.com/8jdewx4ipwb9hro2oedjkfj1cy0f&fit=cover&w=200&h=307',
|
||||
url: 'https://app.thestorygraph.com/books/9946c834-81f1-4c7f-b7d1-30a804e9874f',
|
||||
},
|
||||
{
|
||||
alt: 'Where Are Your Boys Tonight?',
|
||||
author: 'Chris Payne',
|
||||
image: 'https://cd-books.b-cdn.net/vajp3jxy6kee5ka2ymbvjc2fqkvf',
|
||||
image: 'https://coryd.dev/.netlify/images/?url=https://cdn.thestorygraph.com/vajp3jxy6kee5ka2ymbvjc2fqkvf&fit=cover&w=200&h=307',
|
||||
url: 'https://app.thestorygraph.com/books/f074d4e3-a9fc-42af-889e-54697a1fece0',
|
||||
},
|
||||
{
|
||||
title: 'Trouble Boys',
|
||||
author: 'Bob Mehr',
|
||||
image: 'https://cd-books.b-cdn.net/66eh71z4igv2dsinrk7mif50fa6y',
|
||||
image: 'https://coryd.dev/.netlify/images/?url=https://cdn.thestorygraph.com/66eh71z4igv2dsinrk7mif50fa6y&fit=cover&w=200&h=307',
|
||||
url: 'https://app.thestorygraph.com/books/8dce0e20-fef1-42a4-a59b-b4ec084dc6f4',
|
||||
},
|
||||
{
|
||||
alt: 'Corporate Rock Sucks',
|
||||
author: 'Jim Ruland',
|
||||
image: 'https://cd-books.b-cdn.net/tzf2l7725ydzzvvmzpbky7wj7ckc',
|
||||
image: 'https://coryd.dev/.netlify/images/?url=https://cdn.thestorygraph.com/tzf2l7725ydzzvvmzpbky7wj7ckc&fit=cover&w=200&h=307',
|
||||
url: 'https://app.thestorygraph.com/books/8a0b8649-8939-4753-8e8d-18500574614e',
|
||||
},
|
||||
{
|
||||
alt: 'Tracers in the Dark',
|
||||
author: 'Andy Greenberg',
|
||||
image: 'https://cd-books.b-cdn.net/m4s6lp9eljzk5vjm1xauou8frxde',
|
||||
image: 'https://coryd.dev/.netlify/images/?url=https://cdn.thestorygraph.com/m4s6lp9eljzk5vjm1xauou8frxde&fit=cover&w=200&h=307',
|
||||
url: 'https://app.thestorygraph.com/books/4f1f21f8-3d1f-4162-9f6c-5a00a33f629c',
|
||||
},
|
||||
{
|
||||
alt: 'Girl in a Band',
|
||||
author: 'Kim Gordon',
|
||||
image: 'https://cd-books.b-cdn.net/qnxw68i4xn3byegvkzq6kty0rlx7',
|
||||
image: 'https://coryd.dev/.netlify/images/?url=https://cdn.thestorygraph.com/qnxw68i4xn3byegvkzq6kty0rlx7&fit=cover&w=200&h=307',
|
||||
url: 'https://app.thestorygraph.com/books/c0ea8ac6-d2c6-43b6-be16-ba793e71bfc2',
|
||||
}
|
||||
],
|
||||
|
@ -41,56 +41,56 @@ export default {
|
|||
{
|
||||
title: 'the whaler',
|
||||
artist: 'home is where',
|
||||
image: 'https://cdn.coryd.dev/albums/home-is-where-the-whaler.jpg',
|
||||
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',
|
||||
url: 'https://musicbrainz.org/release-group/6fe3516f-c324-4265-8f43-d902f3a4cc20',
|
||||
type: 'album',
|
||||
},
|
||||
{
|
||||
title: 'The Enduring Spirit',
|
||||
artist: 'Tomb Mold',
|
||||
image: 'https://cdn.coryd.dev/albums/tomb-mold-the-enduring-spirit.jpg',
|
||||
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',
|
||||
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://cdn.coryd.dev/albums/vertebra-atlantis-a-dialogue-with-the-eeriest-sublime.jpg',
|
||||
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',
|
||||
url: 'https://musicbrainz.org/release-group/b8f1913b-f461-443c-a26c-377b259f2af6',
|
||||
type: 'album',
|
||||
},
|
||||
{
|
||||
title: 'ONE MORE TIME...',
|
||||
artist: 'blink-182',
|
||||
image: 'https://cdn.coryd.dev/albums/blink-182-one-more-time.jpg',
|
||||
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',
|
||||
url: 'https://musicbrainz.org/release-group/520d6d45-19c8-4ee1-a954-180e7902f3da',
|
||||
type: 'album',
|
||||
},
|
||||
{
|
||||
title: 'Life Like',
|
||||
artist: 'Dead Bob',
|
||||
image: 'https://cdn.coryd.dev/albums/dead-bob-life-like.jpg',
|
||||
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',
|
||||
url: 'https://musicbrainz.org/release-group/ab53e625-74af-4a09-a8ff-e1c08dbae596',
|
||||
type: 'album',
|
||||
},
|
||||
{
|
||||
title: 'Threads of Unknowing',
|
||||
artist: 'VoidCeremony',
|
||||
image: 'https://cdn.coryd.dev/albums/voidceremony-threads-of-unknowing.jpg',
|
||||
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',
|
||||
url: 'https://musicbrainz.org/release-group/f1f91cde-ff57-41c8-bd58-28c236b3f0c6',
|
||||
type: 'album',
|
||||
},
|
||||
{
|
||||
title: 'Why Would I Watch',
|
||||
artist: 'Hot Mulligan',
|
||||
image: 'https://cdn.coryd.dev/albums/hot-mulligan-why-would-i-watch.jpg',
|
||||
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',
|
||||
url: 'https://musicbrainz.org/release-group/5afd31ea-3a96-4b99-a477-4d121efaedec',
|
||||
type: 'album',
|
||||
},
|
||||
{
|
||||
title: 'Losing What We Love',
|
||||
artist: 'Knuckle Puck',
|
||||
image: 'https://cdn.coryd.dev/albums/knuckle-puck-losing-what-we-love.jpg',
|
||||
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',
|
||||
url: 'https://musicbrainz.org/release-group/b51d8882-3854-400a-b79b-4353a77a389b',
|
||||
type: 'album',
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ export default async function () {
|
|||
})
|
||||
const tmdbData = await tmdbRes
|
||||
const posterPath = tmdbData['poster_path']
|
||||
episode.image = `https://cd-movies.b-cdn.net/t/p/w500${posterPath}`
|
||||
episode.image = `https://coryd.dev/.netlify/images/?url=https://image.tmdb.org//t/p/w500${posterPath}&w=200&h=307&fit=fill`
|
||||
}
|
||||
|
||||
return episodes;
|
||||
|
|
Reference in a new issue