chore: misc cleanup
This commit is contained in:
parent
794ba63876
commit
1806afc9aa
6 changed files with 7 additions and 2 deletions
|
@ -1,4 +1,5 @@
|
|||
import { createRequire } from 'module'
|
||||
|
||||
const require = createRequire(import.meta.url)
|
||||
const books = require('./json/read.json')
|
||||
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
export default async function () {
|
||||
const { ActivityFeed } = await import('@11ty/eleventy-activity-feed')
|
||||
const feed = new ActivityFeed()
|
||||
|
||||
feed.addSource('rss', '📝', 'https://coryd.dev/feeds/posts')
|
||||
feed.addSource('rss', '🎥', 'https://coryd.dev/feeds/movies')
|
||||
feed.addSource('rss', '📖', 'https://coryd.dev/feeds/books')
|
||||
feed.addSource('rss', '🔗', 'https://coryd.dev/feeds/links')
|
||||
feed.addSource('rss', '🎧', 'https://coryd.dev/feeds/weekly-artist-chart')
|
||||
|
||||
const entries = feed.getEntries().catch()
|
||||
const res = await entries
|
||||
const activity = { posts: [] }
|
||||
|
@ -19,5 +21,6 @@ export default async function () {
|
|||
date_published: entry.published,
|
||||
})
|
||||
})
|
||||
|
||||
return activity
|
||||
}
|
|
@ -1,5 +1,3 @@
|
|||
export const artistCapitalization = (artist) => artistCapitalizationPatches[artist?.toLowerCase()] || artist
|
||||
|
||||
const sanitizeMediaString = (string) => string.normalize('NFD').replace(/[\u0300-\u036f\u2010—\.\?\(\)\[\]\{\}]/g, '').replace(/\.{3}/g, '')
|
||||
const artistSanitizedKey = (artist) => `${sanitizeMediaString(artist).replace(/\s+/g, '-').toLowerCase()}`
|
||||
const albumSanitizedKey = (artist, album) => `${sanitizeMediaString(artist).replace(/\s+/g, '-').toLowerCase()}-${sanitizeMediaString(album.replace(/[:\/\\,'']+/g
|
||||
|
|
|
@ -6,5 +6,6 @@ export default async function () {
|
|||
const artists = JSON.parse(await readFile('./src/_data/json/artists-map.json', 'utf8'));
|
||||
const albums = JSON.parse(await readFile('./src/_data/json/albums-map.json', 'utf8'));
|
||||
const nowPlaying = JSON.parse(await readFile('./src/_data/json/now-playing.json', 'utf8'));
|
||||
|
||||
return buildChart(window['data'], artists, albums, nowPlaying)
|
||||
}
|
|
@ -8,6 +8,7 @@ export default async function () {
|
|||
const artists = JSON.parse(await readFile('./src/_data/json/artists-map.json', 'utf8'));
|
||||
const albums = JSON.parse(await readFile('./src/_data/json/albums-map.json', 'utf8'));
|
||||
const recent = JSON.parse(await readFile('./src/_data/json/scrobbles-window.json', 'utf8'))['data'].reverse().splice(0,10)
|
||||
|
||||
return {
|
||||
recent: buildTracksWithArt(recent, artists, albums),
|
||||
month: buildChart(monthChart['data'], artists, albums),
|
||||
|
|
|
@ -7,5 +7,6 @@ export default async function () {
|
|||
type: 'json',
|
||||
}).catch()
|
||||
const status = await res
|
||||
|
||||
return status.response['statuses'][0]
|
||||
}
|
||||
|
|
Reference in a new issue