add rating system
This commit is contained in:
@@ -93,6 +93,10 @@ function buildGame(
|
||||
: null,
|
||||
gameFiles,
|
||||
platforms,
|
||||
userRating: null,
|
||||
aiDescription: null,
|
||||
extractedText: null,
|
||||
extractedTextTranslated: null,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,10 +179,15 @@ export function gamesFromDb(libraryId: string): (Game | GameSeries)[] {
|
||||
parent_key: string | null
|
||||
title: string | null
|
||||
metadata: string | null
|
||||
user_rating: number | null
|
||||
ai_description: string | null
|
||||
extracted_text: string | null
|
||||
extracted_text_translated: string | null
|
||||
}
|
||||
|
||||
const allRows = db
|
||||
.prepare(`SELECT item_key, item_type, parent_key, title, metadata
|
||||
.prepare(`SELECT item_key, item_type, parent_key, title, metadata,
|
||||
user_rating, ai_description, extracted_text, extracted_text_translated
|
||||
FROM media_items
|
||||
WHERE library_id = ? AND item_type IN ('game', 'game_series')
|
||||
ORDER BY title`)
|
||||
@@ -233,6 +242,10 @@ export function gamesFromDb(libraryId: string): (Game | GameSeries)[] {
|
||||
wideCoverUrl: meta.wideCoverUrl ?? null,
|
||||
gameFiles,
|
||||
platforms,
|
||||
userRating: row.user_rating ?? null,
|
||||
aiDescription: row.ai_description ?? null,
|
||||
extractedText: row.extracted_text ?? null,
|
||||
extractedTextTranslated: row.extracted_text_translated ?? null,
|
||||
}
|
||||
if (row.parent_key && seriesMap.has(row.parent_key)) {
|
||||
seriesMap.get(row.parent_key)!.games.push(game)
|
||||
|
||||
Reference in New Issue
Block a user