Files
jellyfin-plugin-recently-ad…/Jellyfin.Plugin.RecentlyAddedGuard/Core/GuardOptions.cs
T
Jonas MenzelandClaude Opus 5.5 d431486095
build / build (push) Successful in 1m10s
release / release (push) Failing after 1m36s
feat: Recently Added Guard plugin for Jellyfin 12.2
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>
2026-10-21 23:10:02 +02:00

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));
}