using System;
namespace Jellyfin.Plugin.RecentlyAddedGuard.Core;
///
/// The settings the core logic depends on, decoupled from the Jellyfin plugin configuration.
///
/// Days within which a returning medium counts as an upgrade.
/// Date differences up to this many seconds are ignored.
/// Only log detected upgrades, never change items.
public sealed record GuardOptions(int GraceDays, int ToleranceSeconds, bool DryRun)
{
///
/// Gets the defaults (14 days, 60 seconds, no dry run).
///
public static GuardOptions Default { get; } = new(14, 60, false);
///
/// Gets the grace period.
///
public TimeSpan GracePeriod => TimeSpan.FromDays(Math.Max(0, GraceDays));
///
/// Gets the tolerance for date comparisons.
///
public TimeSpan Tolerance => TimeSpan.FromSeconds(Math.Max(0, ToleranceSeconds));
}