Fichiers
jellyfin-plugin-sharelinks/Jellyfin.Plugin.ShareLinks/Configuration/PluginConfiguration.cs
T
Franciskid 224a79f7e5 cap how many people can watch one multi-use link at once
New setting, ten by default, zero for no limit. Single-use links are unaffected,
they are one viewer by definition.

The catch is what happens at the ceiling. Jellyfin throws SecurityException once a
user is at MaxActiveSessions, and that was landing in the generic handler, which
marks the record failed and runs cleanup, which deletes the guest account. So
without care, adding a ceiling would mean the eleventh person to open a link kicks
out the ten already watching and destroys the link. Capacity is caught separately
now: the record goes back to the state it was in, nothing is torn down, and the
new arrival gets a 503 page inviting them to try again.

Worth being honest that this caps how many people can start watching at once, not
how many ever get in: each redemption issues its own session token that keeps
working until the link is revoked or expires. Revoke is still the hard stop.

README picks up the multi-use option, the new setting, and a section on what a
multi-use link does and does not protect, plus the known limits around the token
in the query string, the unthrottled redeem endpoint, and the tag being hidden in
the web UI only.
2026-07-26 21:22:20 +02:00

58 lignes
2.4 KiB
C#

using MediaBrowser.Model.Plugins;
namespace Jellyfin.Plugin.ShareLinks.Configuration;
/// <summary>
/// Plugin configuration persisted by Jellyfin.
/// </summary>
public class PluginConfiguration : BasePluginConfiguration
{
/// <summary>Gets or sets a value indicating whether the plugin is enabled.</summary>
public bool Enabled { get; set; } = true;
/// <summary>Gets or sets the default share expiry in hours.</summary>
public int DefaultExpiryHours { get; set; } = 24;
/// <summary>Gets or sets the maximum allowed share expiry in hours.</summary>
public int MaxExpiryHours { get; set; } = 720;
/// <summary>
/// Gets or sets an override for the public base URL used when building
/// absolute share links. Empty means "derive from the incoming request".
/// </summary>
public string PublicBaseUrlOverride { get; set; } = string.Empty;
/// <summary>
/// Gets or sets the prefix used when creating guest user names.
/// </summary>
public string GuestUsernamePrefix { get; set; } = "share-";
/// <summary>Gets or sets a value indicating whether shares may transcode.</summary>
public bool AllowTranscoding { get; set; } = true;
/// <summary>Gets or sets a value indicating whether shares may remux.</summary>
public bool AllowRemuxing { get; set; } = true;
/// <summary>Gets or sets the cleanup interval, in minutes.</summary>
public int CleanupIntervalMinutes { get; set; } = 60;
/// <summary>Gets or sets a value indicating whether links default to one use.</summary>
public bool OneUseDefault { get; set; } = true;
/// <summary>
/// Gets or sets how many people may watch a multi-use link at the same time.
/// 0 means no limit. One-use links are always a single viewer regardless.
/// </summary>
public int MaxConcurrentViewers { get; set; } = 10;
/// <summary>Gets or sets a value indicating whether guest-mode lockdown is enabled.</summary>
public bool GuestModeLockdownEnabled { get; set; } = true;
/// <summary>
/// Gets or sets a comma-separated list of CSS selectors that are hidden from guest
/// sessions in the web client. Used to suppress other plugins' injected UI (search
/// bars, floating buttons) so a guest only sees the shared title. Empty by default.
/// </summary>
public string GuestHiddenSelectors { get; set; } = string.Empty;
}