fix(api): normalise the Next Up cutoff to UTC #30
Reference in New Issue
Block a user
Delete Branch "benvin/nextup-datetime-kind"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
GET /Shows/NextUp returns 500 on the PostgreSQL backend. The model binder hands
nextUpDateCutoffover asDateTimeKind.Unspecified, and Npgsql refuses to write anything but UTC totimestamp with time zone, so the Next Up series lookup throws on enumeration. SQLite normalises kinds in its provider and hides this.TvShowsController.GetNextUpNextUpQuery.NextUpDateCutoffto a UTCDateTime.MinValueCloses #26
nit:
MediaBrowser.Model/Querying/NextUpQuery.cs:15/Jellyfin.Api/Controllers/TvShowsController.cs:111— theDateTime.MinValueKind-normalisation is a no-op, not part of the fix: verified against Npgsql 10.0.3 + PG16 thatDateTime.MinValuewrites totimestamp with time zonefine regardless of Kind (Unspecified/Local/Utc all succeed); only a non-MinValue cutoff with a non-Utc Kind throws → correct the PR description, this bullet does not address the 500.nit:
tests/Jellyfin.Server.Tests/Item/PostgreSqlNextUpServiceTests.cs:35-36,91— comment states the model binder "hands a query-string date over as Unspecified"; verified that only holds for a tz-less string, aZ/offset-suffixed cutoff binds asDateTimeKind.Localinstead → reword to cover both cases.