Files
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

30 lines
1.1 KiB
C#

using System;
using System.Threading;
using System.Threading.Tasks;
namespace Jellyfin.Plugin.RecentlyAddedGuard.Core;
/// <summary>
/// An external source for the first "date added" of a medium, e.g. the import history of Radarr or Sonarr.
/// </summary>
/// <remarks>
/// Extension point for v2: implementations registered in the DI container are consulted by the
/// ledger synchronization, and earlier dates lower the ledger via <see cref="Reconciler.ApplyExternalFirstAdded"/>.
/// v1 ships no implementation.
/// </remarks>
public interface IExternalDateSource
{
/// <summary>
/// Gets the name of the source for logs.
/// </summary>
string Name { get; }
/// <summary>
/// Looks up when the medium was first imported.
/// </summary>
/// <param name="identity">The medium.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>The first import date (UTC), or <c>null</c> if unknown.</returns>
Task<DateTime?> GetFirstAddedAsync(MediaIdentity identity, CancellationToken cancellationToken);
}