fix: correct type assertions and ISBN type mismatches

- Fix type assertion panics in library.go (lines 58, 109, 237)
  Changed from *database.Users to database.Users to match JWT middleware
- Fix ISBN type mismatch in ebook.go (lines 249, 308)
  Changed from pgtype.Text to string to match database schema
- Fix ISBN type mismatch in ebook_scanner.go (line 421)
  Changed from pgtype.Text to string to match database schema

These changes fix 500 errors in library creation and ebook operations.
This commit is contained in:
2026-01-29 13:32:56 -05:00
parent 5f355266e4
commit 305deac4fd
3 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -418,7 +418,7 @@ func (s *EbookScanner) updateEbook(ctx context.Context, ebookID pgtype.UUID, fil
ID: ebookID,
Title: metadata.Title,
Author: pgtype.Text{String: metadata.Author, Valid: metadata.Author != ""},
Isbn: pgtype.Text{String: metadata.ISBN, Valid: metadata.ISBN != ""},
Isbn: metadata.ISBN,
Description: pgtype.Text{String: metadata.Description, Valid: metadata.Description != ""},
CoverImagePath: pgtype.Text{String: metadata.CoverPath, Valid: metadata.CoverPath != ""},
Series: pgtype.Text{String: metadata.Series, Valid: metadata.Series != ""},