using ErsatzTV.Core.Domain; using ErsatzTV.Core.Interfaces.Repositories; namespace ErsatzTV.Application.Configuration; public class GetXmltvSettingsHandler(IConfigElementRepository configElementRepository) : IRequestHandler { public async Task Handle(GetXmltvSettings request, CancellationToken cancellationToken) { Option daysToBuild = await configElementRepository.GetValue(ConfigElementKey.XmltvDaysToBuild); Option maybeTimeZone = await configElementRepository.GetValue(ConfigElementKey.XmltvTimeZone); return new XmltvSettingsViewModel { DaysToBuild = await daysToBuild.IfNoneAsync(2), TimeZone = await maybeTimeZone.IfNoneAsync(XmltvTimeZone.Local) }; } }