fix(library): drop out-of-range release years instead of failing the album #12

Merged
bvandeusen merged 262 commits from dev into main 2026-04-20 00:22:20 -04:00
bvandeusen commented 2026-04-20 00:16:15 -04:00 (Migrated from git.fabledsword.com)

Summary

Tag-supplied release years were going straight to Postgres' date column with no validation. Files whose tags carry corrupt or 5+ digit years (a couple of dozen on the dev test library) tripped SQLSTATE 22008 (datetime field overflow) and the entire album upsert failed — every track on those albums got dropped from the library with library scan file error … err="album: ERROR: date out of range".

  • Add releaseDateFromYear helper that accepts only 1..9999.
  • Out-of-range years log a warning naming the album + year and insert the album with no release_date. Soft field shouldn't sink the row.

Test plan

  • Unit test for releaseDateFromYear covering boundaries (0, -1, 1, 9999, 10000)
  • After merge: docker compose up --build, trigger a rescan, scan errors should drop to just the 8.3 short-name issue
  • Previously-failing albums (COIN, DROELOE, FKJ, …) appear in the library

🤖 Generated with Claude Code

## Summary Tag-supplied release years were going straight to Postgres' `date` column with no validation. Files whose tags carry corrupt or 5+ digit years (a couple of dozen on the dev test library) tripped `SQLSTATE 22008` (datetime field overflow) and the entire album upsert failed — every track on those albums got dropped from the library with `library scan file error … err="album: ERROR: date out of range"`. - Add `releaseDateFromYear` helper that accepts only `1..9999`. - Out-of-range years log a warning naming the album + year and insert the album with no `release_date`. Soft field shouldn't sink the row. ## Test plan - [x] Unit test for `releaseDateFromYear` covering boundaries (0, -1, 1, 9999, 10000) - [ ] After merge: `docker compose up --build`, trigger a rescan, scan errors should drop to just the 8.3 short-name issue - [ ] Previously-failing albums (COIN, DROELOE, FKJ, …) appear in the library 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bvandeusen/minstrel#12