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

66 lines
2.3 KiB
C#

using System;
using System.Collections.Generic;
using System.Globalization;
using Jellyfin.Plugin.RecentlyAddedGuard.Configuration;
using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Plugins;
using MediaBrowser.Model.Plugins;
using MediaBrowser.Model.Serialization;
namespace Jellyfin.Plugin.RecentlyAddedGuard;
/// <summary>
/// Keeps quality upgrades from Radarr and Sonarr out of "Recently Added".
/// </summary>
public class Plugin : BasePlugin<PluginConfiguration>, IHasWebPages
{
/// <summary>
/// The permanent plugin id. Never change it: it identifies the plugin in the catalog and in installations.
/// </summary>
public const string PluginGuid = "6fdfedef-adde-4ac3-a873-62a057c95574";
private static readonly Guid _pluginId = Guid.Parse(PluginGuid);
/// <summary>
/// Initializes a new instance of the <see cref="Plugin"/> class.
/// </summary>
/// <param name="applicationPaths">The application paths.</param>
/// <param name="xmlSerializer">The XML serializer.</param>
public Plugin(IApplicationPaths applicationPaths, IXmlSerializer xmlSerializer)
: base(applicationPaths, xmlSerializer)
{
Instance = this;
}
/// <summary>
/// Gets the plugin instance; set once Jellyfin has created the plugin.
/// </summary>
public static Plugin? Instance { get; private set; }
/// <inheritdoc />
public override string Name => "Recently Added Guard";
/// <inheritdoc />
public override Guid Id => _pluginId;
/// <inheritdoc />
public override string Description
=> "Hält Qualitäts-Upgrades von Radarr und Sonarr aus „Zuletzt hinzugefügt“ fern, indem es das erste Hinzufügedatum pro Film und Episode bewahrt.";
/// <summary>
/// Gets the current configuration, or the defaults before the plugin is loaded.
/// </summary>
internal static PluginConfiguration CurrentConfiguration => Instance?.Configuration ?? new PluginConfiguration();
/// <inheritdoc />
public IEnumerable<PluginPageInfo> GetPages()
{
yield return new PluginPageInfo
{
Name = "RecentlyAddedGuard",
DisplayName = Name,
EmbeddedResourcePath = string.Format(CultureInfo.InvariantCulture, "{0}.Configuration.configPage.html", GetType().Namespace)
};
}
}