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>
37 lines
1.3 KiB
C#
37 lines
1.3 KiB
C#
using System;
|
|
|
|
namespace Jellyfin.Plugin.RecentlyAddedGuard.Core;
|
|
|
|
/// <summary>
|
|
/// What the <see cref="Reconciler"/> concluded for an item.
|
|
/// </summary>
|
|
public enum ReconcileAction
|
|
{
|
|
/// <summary>The item has no identity keys (yet) and was skipped.</summary>
|
|
Ignored,
|
|
|
|
/// <summary>A new medium; a ledger entry was created with the item's date.</summary>
|
|
Registered,
|
|
|
|
/// <summary>A known medium whose date matches the ledger.</summary>
|
|
Unchanged,
|
|
|
|
/// <summary>The item is older than the ledger (e.g. a date from an NFO); the ledger took the earlier date.</summary>
|
|
FirstAddedLowered,
|
|
|
|
/// <summary>The medium returned after the grace period; it counts as new and the ledger took its date.</summary>
|
|
ReturnedAfterGrace,
|
|
|
|
/// <summary>The item is newer than the ledger: an upgrade whose date has to be restored.</summary>
|
|
UpgradeDetected
|
|
}
|
|
|
|
/// <summary>
|
|
/// The outcome of reconciling one item with the ledger.
|
|
/// </summary>
|
|
/// <param name="Action">The conclusion.</param>
|
|
/// <param name="Identity">The item.</param>
|
|
/// <param name="ItemDate">The item's "date added" as evaluated (UTC).</param>
|
|
/// <param name="FirstAdded">The ledger's first "date added" after reconciling (UTC).</param>
|
|
public sealed record ReconcileResult(ReconcileAction Action, MediaIdentity Identity, DateTime ItemDate, DateTime FirstAdded);
|