1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-20 21:54:58 -04:00
Files
Sonarr/src/Sonarr.Api.V3/Config/UiConfigResource.cs
T

46 lines
1.5 KiB
C#

using NzbDrone.Core.Configuration;
using Sonarr.Http.REST;
namespace Sonarr.Api.V3.Config
{
public class UiConfigResource : RestResource
{
// Calendar
public int FirstDayOfWeek { get; set; }
public string CalendarWeekColumnHeader { get; set; }
// Dates
public string ShortDateFormat { get; set; }
public string LongDateFormat { get; set; }
public string TimeFormat { get; set; }
public string TimeZone { get; set; }
public bool ShowRelativeDates { get; set; }
public bool EnableColorImpairedMode { get; set; }
public string Theme { get; set; }
public int UILanguage { get; set; }
}
public static class UiConfigResourceMapper
{
public static UiConfigResource ToResource(IConfigFileProvider config, IConfigService model)
{
return new UiConfigResource
{
FirstDayOfWeek = model.FirstDayOfWeek,
CalendarWeekColumnHeader = model.CalendarWeekColumnHeader,
ShortDateFormat = model.ShortDateFormat,
LongDateFormat = model.LongDateFormat,
TimeFormat = model.TimeFormat,
TimeZone = model.TimeZone,
ShowRelativeDates = model.ShowRelativeDates,
EnableColorImpairedMode = model.EnableColorImpairedMode,
Theme = config.Theme,
UILanguage = model.UILanguage
};
}
}
}