mirror of
https://github.com/kikootwo/ReadMeABook.git
synced 2026-06-02 20:30:10 +00:00
fix: use BigInt for PlexLibrary.duration to prevent INT4 overflow
The duration column (Int/int4, max ~2.15B) overflows when storing millisecond values for items with large durations from Audiobookshelf or Plex backends. Change to BigInt (int8) and wrap duration calculations in BigInt() at the Prisma write boundary. Changes: - prisma/schema.prisma: PlexLibrary.duration Int? → BigInt? - plex-recently-added.processor.ts: BigInt(Math.round(...)) wrapping - scan-plex.processor.ts: same BigInt wrapping - documentation/backend/database.md: updated duration type notation Fixes #193 Co-Authored-By: Oz <oz-agent@warp.dev>
This commit is contained in:
@@ -132,7 +132,7 @@ model PlexLibrary {
|
||||
author String
|
||||
narrator String?
|
||||
summary String? @db.Text
|
||||
duration Int? // Duration in milliseconds (Plex format)
|
||||
duration BigInt? // Duration in milliseconds (Plex format)
|
||||
year Int?
|
||||
userRating Decimal? @map("user_rating") @db.Decimal(3, 1) // User's rating (0-10 scale from Plex)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user