Keeps Radarr/Sonarr quality upgrades out of "Recently Added" by keeping a ledger of the first date added per logical medium (movie or episode, identified by provider ids and the series) and restoring it on upgrades. - core logic without Jellyfin types (Reconciler, MediaKeys, GuardProcessor) - thread-safe ledger with atomic, debounced persistence - event processing via channel and background worker, seed on first start - scheduled task "Ledger synchronisieren", status API, configuration page - xUnit tests and a Jellyfin 12.2 integration test - Gitea workflows: build/test, release with jprm and manifest branch Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
28 lines
1.0 KiB
C#
28 lines
1.0 KiB
C#
using System;
|
|
|
|
namespace Jellyfin.Plugin.RecentlyAddedGuard.Core;
|
|
|
|
/// <summary>
|
|
/// The settings the core logic depends on, decoupled from the Jellyfin plugin configuration.
|
|
/// </summary>
|
|
/// <param name="GraceDays">Days within which a returning medium counts as an upgrade.</param>
|
|
/// <param name="ToleranceSeconds">Date differences up to this many seconds are ignored.</param>
|
|
/// <param name="DryRun">Only log detected upgrades, never change items.</param>
|
|
public sealed record GuardOptions(int GraceDays, int ToleranceSeconds, bool DryRun)
|
|
{
|
|
/// <summary>
|
|
/// Gets the defaults (14 days, 60 seconds, no dry run).
|
|
/// </summary>
|
|
public static GuardOptions Default { get; } = new(14, 60, false);
|
|
|
|
/// <summary>
|
|
/// Gets the grace period.
|
|
/// </summary>
|
|
public TimeSpan GracePeriod => TimeSpan.FromDays(Math.Max(0, GraceDays));
|
|
|
|
/// <summary>
|
|
/// Gets the tolerance for date comparisons.
|
|
/// </summary>
|
|
public TimeSpan Tolerance => TimeSpan.FromSeconds(Math.Max(0, ToleranceSeconds));
|
|
}
|