chore: 11ty img

This commit is contained in:
Cory Dransfeldt 2024-06-06 14:55:19 -07:00
parent 2bcd6d3ee7
commit 73eb06739e
No known key found for this signature in database
23 changed files with 728 additions and 270 deletions

View file

@ -10,7 +10,7 @@ export default async function () {
"locale": "en_US",
"lang": "en",
"meta_data": {
"opengraph_default": "https://coryd.dev/.netlify/images/?url=/assets/img/avatar.png&w=500&h=500&fm=webp"
"opengraph_default": "/assets/img/avatar.png"
}
}
}

View file

@ -40,6 +40,8 @@ const fetchAllMovies = async () => {
rangeStart += PAGE_SIZE
}
movies = movies.filter(movie => movie.last_watched)
return movies
}
@ -66,6 +68,7 @@ export default async function () {
}
return movie
}).filter(movie => watched ? movie['lastWatched'] : !movie['lastWatched'])
const favoriteMovies = movies.filter(movie => movie['favorite'])
const collectedMovies = movies.filter(movie => movie['collected'])
const recentlyWatchedMovies = movies.filter(movie => movie['last_watched']).sort((a, b) => new Date(b['last_watched']) - new Date(a['last_watched']))

View file

@ -40,6 +40,10 @@ const fetchAllShows = async () => {
rangeStart += PAGE_SIZE
}
shows = shows.filter(show =>
show.episodes.some(episode => episode.last_watched_at)
)
return shows
}
@ -96,8 +100,8 @@ export default async function () {
season: seasonNumber,
tmdbId: showTmdbId,
type: 'tv',
image: `/media/shows/poster-${showTmdbId}.jpg`,
backdrop: `/media/shows/backdrops/backdrop-${showTmdbId}.jpg`,
image: `https://coryd.dev/media/shows/poster-${showTmdbId}.jpg`,
backdrop: `https://coryd.dev/media/shows/backdrops/backdrop-${showTmdbId}.jpg`,
dateAdded: lastWatchedAt,
lastWatchedAt
})
@ -124,8 +128,8 @@ export default async function () {
collected: show['collected'],
favorite: show['favorite'],
type: 'tv-range',
image: `/media/shows/poster-${show['tmdbId']}.jpg`,
backdrop: `/media/shows/backdrops/backdrop-${show['tmdbId']}.jpg`,
image: `https://coryd.dev/media/shows/poster-${show['tmdbId']}.jpg`,
backdrop: `https://coryd.dev/media/shows/backdrops/backdrop-${show['tmdbId']}.jpg`,
})
} else {
const singleEpisode = show['episodes'][0]
@ -139,8 +143,6 @@ export default async function () {
}
const favoriteShows = shows.filter(show => show['favorite'])
const collectedShows = shows.filter(show => show['collected'])
const toWatch = shows.map(show => ({...show, url: `/watching/shows/${show['tmdb_id']}`})).filter(show => !show.episodes.some(episode => episode.last_watched_at)).sort((a, b) => a['title'].localeCompare(b['title']))
return {
shows,