fix: address #93 adversarial review findings
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:
@@ -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)
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user