Jellyfin-AutoBackup/Configuration/BackupScheduleConfig.cs

40 lines
1.6 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

namespace Jellyfin.Plugin.AutoBackup.Configuration;
public class BackupScheduleConfig
{
public Guid Id { get; set; } = Guid.NewGuid();
public string Label { get; set; } = "Schedule";
public bool IsEnabled { get; set; } = true;
public bool BackupDatabase { get; set; } = true;
public bool BackupMetadata { get; set; } = false;
public bool BackupSubtitles { get; set; } = false;
public bool BackupTrickplay { get; set; } = false;
public ScheduleType ScheduleType { get; set; } = ScheduleType.Daily;
/// <summary>Used when ScheduleType is EveryNHours.</summary>
public int IntervalHours { get; set; } = 24;
/// <summary>Used when ScheduleType is EveryNWeeks.</summary>
public int IntervalWeeks { get; set; } = 1;
/// <summary>Used when ScheduleType is Weekly, EveryNWeeks, or MonthlyOnWeekday.</summary>
public DayOfWeek WeekDay { get; set; } = DayOfWeek.Sunday;
/// <summary>Used when ScheduleType is MonthlyOnDay (128).</summary>
public int DayOfMonth { get; set; } = 1;
/// <summary>Used when ScheduleType is MonthlyOnWeekday.</summary>
public WeekOfMonth WeekOfMonth { get; set; } = WeekOfMonth.First;
/// <summary>Hour of day (023) for the trigger.</summary>
public int TriggerHour { get; set; } = 2;
/// <summary>Minute of hour — only 0, 15, 30 or 45 are valid (matches 15-min master task tick).</summary>
public int TriggerMinute { get; set; } = 0;
/// <summary>Persisted after each successful run to calculate next due time.</summary>
public DateTime LastRunUtc { get; set; } = DateTime.MinValue;
}