namespace Jellyfin.Plugin.JRay.Configuration;
///
/// How far a configured manifest server is trusted. See the JRay public server
/// specification, §9 "Trusting third-party servers".
///
public enum ServerTrustLevel
{
///
/// Accept manifests, but never contribute to this server and never send
/// library inventory beyond the single item being queried. The default for
/// user-added servers.
///
FetchOnly = 0,
///
/// Eligible to contribute to, subject to .
///
Full = 1,
}
///
/// The minimum cut-match tier a fetched manifest must reach before it is stored.
/// See the public server specification, §3 "Cut matching".
///
public enum MatchTier
{
/// Audio 0.60–0.85, or runtimes within ±30s. Surfaced as a caveat in the UI.
Loose = 0,
/// Runtimes within ±2s.
Runtime = 1,
/// Audio signature score ≥ 0.85; may carry a non-zero offset.
Audio = 2,
/// Identical video_hash — the same file.
Exact = 3,
}
///
/// One entry in the ordered list of manifest servers the plugin queries
/// (public server specification, §9 "Multiple servers").
///
///
/// The list is ordered because order *is* the user's trust ranking, made
/// explicit: for a fetch, servers are tried in order and the first acceptable
/// result wins. Querying every server for every item would multiply egress and
/// leak the library to more parties.
///
/// FetchOnly is the default for user-added servers. Adding a third-party
/// server means trusting its operator not to serve deliberately wrong actor
/// data — the client-side controls bound the damage to bad overlay content,
/// they cannot make wrong data right.
///
// TRACES: JR-025 | PR-005, PR-006
public class ManifestServer
{
///
/// Initializes a new instance of the class.
///
public ManifestServer()
{
Url = string.Empty;
Name = string.Empty;
Token = string.Empty;
Enabled = false;
AllowContribute = false;
TrustLevel = ServerTrustLevel.FetchOnly;
}
///
/// Gets or sets the base URL of the server, e.g. "https://jray.tourolle.paris".
/// HTTPS is required for non-loopback servers: a plaintext server would let
/// any network intermediary rewrite actor overlays.
///
public string Url { get; set; }
///
/// Gets or sets the display label shown in the configuration page.
///
public string Name { get; set; }
///
/// Gets or sets the API token used to contribute manifests. Optional —
/// required only to contribute, never to fetch. This is an anonymous bearer
/// capability rather than an account (public server specification, §5a).
///
public string Token { get; set; }
///
/// Gets or sets a value indicating whether this server is queried at all.
/// Lets an admin disable an entry without deleting it and losing its token.
///
public bool Enabled { get; set; }
///
/// Gets or sets a value indicating whether locally generated manifests may be
/// contributed to this server. Independent of fetching, and off by default:
/// contribution is never fanned out, because broadcasting uploads to every
/// configured server would multiply privacy exposure without the user
/// intending it.
///
public bool AllowContribute { get; set; }
///
/// Gets or sets how far this server is trusted.
///
public ServerTrustLevel TrustLevel { get; set; }
}