fix: address #93 adversarial review findings
Build ErsatzTV Image / Build & test (.NET) (pull_request) Successful in 4m51s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Successful in 5m21s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Has been skipped

Backend: 401 documented on all mutating settings/resolution routes;
resolution delete distinguishes 404 (unknown) from 422 (not custom);
XMLTV enum bridging via exhaustive switch instead of int casts;
field-level Arg.Is assertions incl. non-null watermark/filler flow.

Frontend: resolution add/delete failures surfaced inline (were
silent); partial saves merge succeeded groups via allSettled; empty
numeric fields invalid + tunerCount min 1; HLS Direct select shows
out-of-list wire values; media-source rows show derived last-scan.

ErsatzTV.Tests 495; web suite 145.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-07 09:22:51 +02:00
co-authored by Claude Fable 5
parent ab9d21326b
commit 540def7f17
10 changed files with 717 additions and 52 deletions
@@ -11,7 +11,23 @@ public record UpdateXmltvSettingsRequest(int DaysToBuild, ApiXmltvTimeZone TimeZ
new XmltvSettingsViewModel
{
DaysToBuild = DaysToBuild,
TimeZone = (XmltvTimeZone)(int)TimeZone,
BlockBehavior = (XmltvBlockBehavior)(int)BlockBehavior
TimeZone = ToVmTimeZone(TimeZone),
BlockBehavior = ToVmBlockBehavior(BlockBehavior)
});
private static XmltvTimeZone ToVmTimeZone(ApiXmltvTimeZone timeZone) =>
timeZone switch
{
ApiXmltvTimeZone.Local => XmltvTimeZone.Local,
ApiXmltvTimeZone.Utc => XmltvTimeZone.Utc,
_ => throw new ArgumentOutOfRangeException(nameof(timeZone), timeZone, null)
};
private static XmltvBlockBehavior ToVmBlockBehavior(ApiXmltvBlockBehavior blockBehavior) =>
blockBehavior switch
{
ApiXmltvBlockBehavior.SplitTimeEvenly => XmltvBlockBehavior.SplitTimeEvenly,
ApiXmltvBlockBehavior.UseActualTimes => XmltvBlockBehavior.UseActualTimes,
_ => throw new ArgumentOutOfRangeException(nameof(blockBehavior), blockBehavior, null)
};
}