35 lines
1.3 KiB
C#
35 lines
1.3 KiB
C#
using System.Collections.Generic;
|
|
using Jellyfin.Plugin.JRay.Models;
|
|
|
|
namespace Jellyfin.Plugin.JRay.Services.Interfaces;
|
|
|
|
/// <summary>
|
|
/// Stores the prioritise/ignore rules that shape the work-discovery API
|
|
/// (<c>GET /Plugins/JRay/Tasks/Pending</c>). Rules can target a genre, a
|
|
/// series, or a single item; more specific scopes override broader ones.
|
|
/// </summary>
|
|
public interface IMediaPolicyStore
|
|
{
|
|
/// <summary>
|
|
/// Gets all currently configured rules.
|
|
/// </summary>
|
|
/// <returns>The list of rules (a copy; safe to enumerate).</returns>
|
|
IReadOnlyList<MediaPolicyRule> GetRules();
|
|
|
|
/// <summary>
|
|
/// Adds or replaces the rule for a given scope+value. If a rule already
|
|
/// exists for the same scope and value, its action and label are updated,
|
|
/// so a target can never hold two conflicting actions.
|
|
/// </summary>
|
|
/// <param name="rule">The rule to set.</param>
|
|
void SetRule(MediaPolicyRule rule);
|
|
|
|
/// <summary>
|
|
/// Removes the rule matching the given scope and value, if present.
|
|
/// </summary>
|
|
/// <param name="scope">The scope of the rule to remove.</param>
|
|
/// <param name="value">The value of the rule to remove.</param>
|
|
/// <returns><c>true</c> if a rule was removed.</returns>
|
|
bool RemoveRule(PolicyScope scope, string value);
|
|
}
|