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>
49 lines
1.7 KiB
C#
49 lines
1.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace Jellyfin.Plugin.RecentlyAddedGuard.Ledger;
|
|
|
|
/// <summary>
|
|
/// The first "date added" of one logical medium (a movie or an episode), independent of its files.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <see cref="Keys"/> and <see cref="LiveItemIds"/> are indexed by the <see cref="LedgerStore"/>;
|
|
/// change them only through the store so the indexes stay consistent.
|
|
/// </remarks>
|
|
public sealed class LedgerEntry
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets all alias keys of the medium (e.g. <c>movie:tmdb:603</c>).
|
|
/// </summary>
|
|
#pragma warning disable CA1819 // Plain persistence model; the store owns all mutations.
|
|
public string[] Keys { get; set; } = [];
|
|
#pragma warning restore CA1819
|
|
|
|
/// <summary>
|
|
/// Gets or sets the protected first "date added" (UTC).
|
|
/// </summary>
|
|
public DateTime FirstAdded { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets when an item of this medium was last seen (UTC).
|
|
/// </summary>
|
|
public DateTime LastSeen { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets when the last live item of this medium disappeared (UTC); <c>null</c> while items exist.
|
|
/// </summary>
|
|
public DateTime? RemovedAt { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the ids of the Jellyfin items currently representing this medium.
|
|
/// </summary>
|
|
#pragma warning disable CA2227 // Plain persistence model; the store owns all mutations.
|
|
public HashSet<Guid> LiveItemIds { get; set; } = [];
|
|
#pragma warning restore CA2227
|
|
|
|
/// <summary>
|
|
/// Gets or sets a display name for logs and the configuration page.
|
|
/// </summary>
|
|
public string DisplayName { get; set; } = string.Empty;
|
|
}
|