using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using MediaBrowser.Model.Plugins;
namespace Jellyfin.Plugin.WatchedTogether.Configuration;
///
/// Plugin configuration. Holds the authoritative record of which members belong to which
/// shared account.
///
public class PluginConfiguration : BasePluginConfiguration
{
///
/// Gets or sets the configured shared-account groups.
///
[SuppressMessage("Usage", "CA2227:Collection properties should be read only", Justification = "Plugin configuration is round-tripped by the XML serializer, which requires a settable List.")]
[SuppressMessage("Design", "CA1002:Do not expose generic lists", Justification = "Plugin configuration is round-tripped by the XML serializer, which requires a settable List.")]
public List Groups { get; set; } = new();
///
/// Gets or sets the separator used to join member names into a shared account name. Also the
/// separator split at login when is on.
///
public string NameSeparator { get; set; } = "+";
///
/// Gets or sets a value indicating whether typing an unrecognised name like "alice+bob" at the
/// login screen creates the shared account on the spot.
///
///
/// The account is only created if every named part is an existing, enabled, non-shared user
/// and the submitted password belongs to one of them. A real account whose name
/// happens to contain the separator always takes precedence, because Jellyfin only consults
/// this plugin once no local user matches the typed name.
///
public bool EnableDynamicGroups { get; set; } = true;
///
/// Gets or sets a value indicating whether accounts created on demand may access all libraries.
///
///
/// Leaving this on means a dynamically created account sees every library, regardless of what
/// its members can each reach individually. Turn it off to have such accounts start with no
/// library access until an administrator grants it.
///
public bool DynamicGroupsEnableAllFolders { get; set; } = true;
}