feat: add ratings
This commit is contained in:
parent
c37fc2f1a3
commit
614d1e210c
13 changed files with 98 additions and 66 deletions
|
@ -22,6 +22,7 @@ export default async function () {
|
|||
status: book['status'],
|
||||
tags: book['tags'],
|
||||
categories: book['categories']?.length > 1 ? book['categories'].join(', ') : book['categories']?.[0],
|
||||
rating: book['rating'] !== 'unrated' ? book['rating'] : '',
|
||||
type: 'book',
|
||||
}
|
||||
})
|
||||
|
|
|
@ -10308,7 +10308,7 @@
|
|||
"isbn": "9781501182891",
|
||||
"dateAdded": "2024-05-03",
|
||||
"status": "finished",
|
||||
"rating": "unrated",
|
||||
"rating": "⭐️⭐️⭐️⭐️",
|
||||
"tags": [
|
||||
"\"politics\"",
|
||||
"\"economics\"",
|
||||
|
|
|
@ -22,7 +22,8 @@ const fetchAllMovies = async () => {
|
|||
year,
|
||||
collected,
|
||||
plays,
|
||||
favorite
|
||||
favorite,
|
||||
rating
|
||||
`)
|
||||
.order('last_watched', { ascending: false })
|
||||
.range(rangeStart, rangeStart + PAGE_SIZE - 1)
|
||||
|
@ -51,12 +52,13 @@ export default async function () {
|
|||
year: item['year'],
|
||||
url: `https://www.themoviedb.org/movie/${item['tmdb_id']}`,
|
||||
description: `<p>${item['title']} (${item['year']})</p><p>Watched at: ${DateTime.fromISO(item['last_watched'], { zone: 'utc' }).setZone('America/Los_Angeles').toFormat('MMMM d, yyyy, h:mma')}</p>`,
|
||||
type: 'movie',
|
||||
image: `https://coryd.dev/media/movies/poster-${item['tmdb_id']}.jpg`,
|
||||
backdrop: `https://coryd.dev/media/movies/backdrops/backdrop-${item['tmdb_id']}.jpg`,
|
||||
plays: item['plays'],
|
||||
collected: item['collected'],
|
||||
favorite: item['favorite'],
|
||||
rating: item['rating'],
|
||||
type: 'movie'
|
||||
}
|
||||
return movie
|
||||
}).filter(movie => watched ? movie['lastWatched'] : !movie['lastWatched'])
|
||||
|
|
Reference in a new issue