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
## 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)
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Tag-supplied release years were going straight to Postgres'
datecolumn with no validation. Files whose tags carry corrupt or 5+ digit years (a couple of dozen on the dev test library) trippedSQLSTATE 22008(datetime field overflow) and the entire album upsert failed — every track on those albums got dropped from the library withlibrary scan file error … err="album: ERROR: date out of range".releaseDateFromYearhelper that accepts only1..9999.release_date. Soft field shouldn't sink the row.Test plan
releaseDateFromYearcovering boundaries (0, -1, 1, 9999, 10000)docker compose up --build, trigger a rescan, scan errors should drop to just the 8.3 short-name issue🤖 Generated with Claude Code