feat: game metadata rating support

This commit is contained in:
Huskydog9988
2025-05-14 21:40:25 -04:00
parent 6df2ef1740
commit bea26a9a6d
8 changed files with 203 additions and 33 deletions

View File

@ -3,6 +3,8 @@ enum MetadataSource {
GiantBomb
PCGamingWiki
IGDB
Metacritic
OpenCritic
}
model Game {
@ -19,8 +21,7 @@ model Game {
mDescription String // Supports markdown
mReleased DateTime // When the game was released
mReviewCount Int
mReviewRating Float // 0 to 1
ratings GameRating[]
mIconObjectId String // linked to objects in s3
mBannerObjectId String // linked to objects in s3
@ -42,6 +43,24 @@ model Game {
@@unique([metadataSource, metadataId], name: "metadataKey")
}
model GameRating {
id String @id @default(uuid())
metadataSource MetadataSource
metadataId String
created DateTime @default(now())
mReviewCount Int
mReviewRating Float // 0 to 1
mReviewHref String?
Game Game? @relation(fields: [gameId], references: [id], onDelete: Cascade)
gameId String?
@@unique([metadataSource, metadataId], name: "metadataKey")
}
// A particular set of files that relate to the version
model GameVersion {
gameId String