using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; namespace Jellyfin.Plugin.WatchedTogether.Configuration; /// /// The association between one shared account and the members who may unlock it. /// /// /// Membership is stored as GUIDs rather than being parsed out of the shared account's username. /// The default separator ('+') is itself a legal username character, so a name like "alice+bob" /// is ambiguous between the group [alice, bob] and a single user literally called "alice+bob". /// GUIDs remove that ambiguity and support any number of members. /// public class SharedGroup { /// /// Gets or sets the identifier of the shared account that members log into collectively. /// public Guid SharedUserId { get; set; } /// /// Gets or sets the identifiers of the members whose passwords unlock the shared account, /// and whose own accounts receive its watched state. A usable group has at least two. /// [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 MemberUserIds { get; set; } = new(); /// /// Gets or sets a value indicating whether marking something unwatched on the shared account /// also marks it unwatched for every member. When false, only the transition to watched /// propagates. /// public bool SyncUnwatched { get; set; } = true; /// /// Gets or sets a value indicating whether a member's play count is raised to at least one /// when an item becomes watched. Play counts are never decremented. /// public bool SyncPlayCount { get; set; } /// /// Gets or sets a value indicating whether this group is suspended. A group drops out of both /// authentication and sync while disabled - set automatically if it falls below two members. /// public bool IsDisabled { get; set; } }