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>
57 lines
1.6 KiB
C#
57 lines
1.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using Jellyfin.Plugin.RecentlyAddedGuard.Core;
|
|
|
|
namespace Jellyfin.Plugin.RecentlyAddedGuard.Api;
|
|
|
|
/// <summary>
|
|
/// Status shown on the configuration page.
|
|
/// </summary>
|
|
public sealed class GuardStatus
|
|
{
|
|
/// <summary>
|
|
/// Gets the number of ledger entries.
|
|
/// </summary>
|
|
public int LedgerEntries { get; init; }
|
|
|
|
/// <summary>
|
|
/// Gets the number of entries with at least one live item.
|
|
/// </summary>
|
|
public int LiveEntries { get; init; }
|
|
|
|
/// <summary>
|
|
/// Gets the number of entries whose items are gone (within the grace period).
|
|
/// </summary>
|
|
public int RemovedEntries { get; init; }
|
|
|
|
/// <summary>
|
|
/// Gets the number of corrections since the server started.
|
|
/// </summary>
|
|
public long CorrectionsSinceStart { get; init; }
|
|
|
|
/// <summary>
|
|
/// Gets the number of upgrades detected in dry-run mode since the server started.
|
|
/// </summary>
|
|
public long DryRunDetectionsSinceStart { get; init; }
|
|
|
|
/// <summary>
|
|
/// Gets a value indicating whether the initial seed has completed.
|
|
/// </summary>
|
|
public bool SeedCompleted { get; init; }
|
|
|
|
/// <summary>
|
|
/// Gets the time of the last seed or synchronization (UTC).
|
|
/// </summary>
|
|
public DateTime? LastSyncUtc { get; init; }
|
|
|
|
/// <summary>
|
|
/// Gets a value indicating whether dry-run mode is active.
|
|
/// </summary>
|
|
public bool DryRun { get; init; }
|
|
|
|
/// <summary>
|
|
/// Gets the most recent corrections, newest first.
|
|
/// </summary>
|
|
public IReadOnlyList<CorrectionRecord> RecentCorrections { get; init; } = [];
|
|
}
|