diff options
49 files changed, 419 insertions, 419 deletions
diff --git a/Jellyfin.Data/Entities/ActivityLog.cs b/Jellyfin.Data/Entities/ActivityLog.cs index 3858916d1..620e82830 100644 --- a/Jellyfin.Data/Entities/ActivityLog.cs +++ b/Jellyfin.Data/Entities/ActivityLog.cs @@ -1,5 +1,3 @@ -#pragma warning disable CS1591 - using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; @@ -11,7 +9,7 @@ namespace Jellyfin.Data.Entities /// <summary> /// An entity referencing an activity log entry. /// </summary> - public partial class ActivityLog : IHasConcurrencyToken + public class ActivityLog : IHasConcurrencyToken { /// <summary> /// Initializes a new instance of the <see cref="ActivityLog"/> class. @@ -32,13 +30,11 @@ namespace Jellyfin.Data.Entities throw new ArgumentNullException(nameof(type)); } - this.Name = name; - this.Type = type; - this.UserId = userId; - this.DateCreated = DateTime.UtcNow; - this.LogSeverity = LogLevel.Trace; - - Init(); + Name = name; + Type = type; + UserId = userId; + DateCreated = DateTime.UtcNow; + LogSeverity = LogLevel.Trace; } /// <summary> @@ -47,38 +43,21 @@ namespace Jellyfin.Data.Entities /// </summary> protected ActivityLog() { - Init(); - } - - /// <summary> - /// Static create function (for use in LINQ queries, etc.) - /// </summary> - /// <param name="name">The name.</param> - /// <param name="type">The type.</param> - /// <param name="userId">The user's id.</param> - /// <returns>The new <see cref="ActivityLog"/> instance.</returns> - public static ActivityLog Create(string name, string type, Guid userId) - { - return new ActivityLog(name, type, userId); } - /************************************************************************* - * Properties - *************************************************************************/ - /// <summary> /// Gets or sets the identity of this instance. /// This is the key in the backing database. /// </summary> - [Key] - [Required] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int Id { get; protected set; } /// <summary> /// Gets or sets the name. - /// Required, Max length = 512. /// </summary> + /// <remarks> + /// Required, Max length = 512. + /// </remarks> [Required] [MaxLength(512)] [StringLength(512)] @@ -86,24 +65,30 @@ namespace Jellyfin.Data.Entities /// <summary> /// Gets or sets the overview. - /// Max length = 512. /// </summary> + /// <remarks> + /// Max length = 512. + /// </remarks> [MaxLength(512)] [StringLength(512)] public string Overview { get; set; } /// <summary> /// Gets or sets the short overview. - /// Max length = 512. /// </summary> + /// <remarks> + /// Max length = 512. + /// </remarks> [MaxLength(512)] [StringLength(512)] public string ShortOverview { get; set; } /// <summary> /// Gets or sets the type. - /// Required, Max length = 256. /// </summary> + /// <remarks> + /// Required, Max length = 256. + /// </remarks> [Required] [MaxLength(256)] [StringLength(256)] @@ -111,43 +96,42 @@ namespace Jellyfin.Data.Entities /// <summary> /// Gets or sets the user id. - /// Required. /// </summary> - [Required] + /// <remarks> + /// Required. + /// </remarks> public Guid UserId { get; set; } /// <summary> /// Gets or sets the item id. - /// Max length = 256. /// </summary> + /// <remarks> + /// Max length = 256. + /// </remarks> [MaxLength(256)] [StringLength(256)] public string ItemId { get; set; } /// <summary> /// Gets or sets the date created. This should be in UTC. - /// Required. /// </summary> - [Required] + /// <remarks> + /// Required. + /// </remarks> public DateTime DateCreated { get; set; } /// <summary> /// Gets or sets the log severity. Default is <see cref="LogLevel.Trace"/>. - /// Required. /// </summary> - [Required] + /// <remarks> + /// Required. + /// </remarks> public LogLevel LogSeverity { get; set; } - /// <summary> - /// Gets or sets the row version. - /// Required, ConcurrencyToken. - /// </summary> + /// <inheritdoc /> [ConcurrencyCheck] - [Required] public uint RowVersion { get; set; } - partial void Init(); - /// <inheritdoc /> public void OnSavingChanges() { diff --git a/Jellyfin.Data/Entities/DisplayPreferences.cs b/Jellyfin.Data/Entities/DisplayPreferences.cs index cda83f6bb..701e4df00 100644 --- a/Jellyfin.Data/Entities/DisplayPreferences.cs +++ b/Jellyfin.Data/Entities/DisplayPreferences.cs @@ -1,4 +1,6 @@ -using System; +#pragma warning disable CA2227 + +using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/Jellyfin.Data/Entities/Group.cs b/Jellyfin.Data/Entities/Group.cs index ca12ba421..878811e59 100644 --- a/Jellyfin.Data/Entities/Group.cs +++ b/Jellyfin.Data/Entities/Group.cs @@ -1,9 +1,8 @@ -#pragma warning disable CS1591 +#pragma warning disable CA2227 using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using Jellyfin.Data.Enums; using Jellyfin.Data.Interfaces; @@ -13,11 +12,10 @@ namespace Jellyfin.Data.Entities /// <summary> /// An entity representing a group. /// </summary> - public partial class Group : IHasPermissions, IHasConcurrencyToken + public class Group : IHasPermissions, IHasConcurrencyToken { /// <summary> /// Initializes a new instance of the <see cref="Group"/> class. - /// Public constructor with required data. /// </summary> /// <param name="name">The name of the group.</param> public Group(string name) @@ -31,33 +29,25 @@ namespace Jellyfin.Data.Entities Id = Guid.NewGuid(); Permissions = new HashSet<Permission>(); - ProviderMappings = new HashSet<ProviderMapping>(); Preferences = new HashSet<Preference>(); - - Init(); } /// <summary> /// Initializes a new instance of the <see cref="Group"/> class. - /// Default constructor. Protected due to required properties, but present because EF needs it. /// </summary> + /// <remarks> + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// </remarks> protected Group() { - Init(); } - /************************************************************************* - * Properties - *************************************************************************/ - /// <summary> /// Gets or sets the id of this group. /// </summary> /// <remarks> /// Identity, Indexed, Required. /// </remarks> - [Key] - [Required] public Guid Id { get; protected set; } /// <summary> @@ -71,42 +61,19 @@ namespace Jellyfin.Data.Entities [StringLength(255)] public string Name { get; set; } - /// <summary> - /// Gets or sets the row version. - /// </summary> - /// <remarks> - /// Required, Concurrency Token. - /// </remarks> + /// <inheritdoc /> [ConcurrencyCheck] - [Required] public uint RowVersion { get; set; } - public void OnSavingChanges() - { - RowVersion++; - } - - /************************************************************************* - * Navigation properties - *************************************************************************/ - - [ForeignKey("Permission_GroupPermissions_Id")] + /// <summary> + /// Gets or sets a collection containing the group's permissions. + /// </summary> public virtual ICollection<Permission> Permissions { get; protected set; } - [ForeignKey("ProviderMapping_ProviderMappings_Id")] - public virtual ICollection<ProviderMapping> ProviderMappings { get; protected set; } - - [ForeignKey("Preference_Preferences_Id")] - public virtual ICollection<Preference> Preferences { get; protected set; } - /// <summary> - /// Static create function (for use in LINQ queries, etc.) + /// Gets or sets a collection containing the group's preferences. /// </summary> - /// <param name="name">The name of this group.</param> - public static Group Create(string name) - { - return new Group(name); - } + public virtual ICollection<Preference> Preferences { get; protected set; } /// <inheritdoc/> public bool HasPermission(PermissionKind kind) @@ -120,6 +87,10 @@ namespace Jellyfin.Data.Entities Permissions.First(p => p.Kind == kind).Value = value; } - partial void Init(); + /// <inheritdoc /> + public void OnSavingChanges() + { + RowVersion++; + } } } diff --git a/Jellyfin.Data/Entities/ImageInfo.cs b/Jellyfin.Data/Entities/ImageInfo.cs index cf0895ad4..ab8452e62 100644 --- a/Jellyfin.Data/Entities/ImageInfo.cs +++ b/Jellyfin.Data/Entities/ImageInfo.cs @@ -1,32 +1,65 @@ -#pragma warning disable CS1591 - -using System; +using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace Jellyfin.Data.Entities { + /// <summary> + /// An entity representing an image. + /// </summary> public class ImageInfo { + /// <summary> + /// Initializes a new instance of the <see cref="ImageInfo"/> class. + /// </summary> + /// <param name="path">The path.</param> public ImageInfo(string path) { Path = path; LastModified = DateTime.UtcNow; } - [Key] - [Required] + /// <summary> + /// Initializes a new instance of the <see cref="ImageInfo"/> class. + /// </summary> + /// <remarks> + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// </remarks> + protected ImageInfo() + { + } + + /// <summary> + /// Gets or sets the id. + /// </summary> + /// <remarks> + /// Identity, Indexed, Required. + /// </remarks> [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int Id { get; protected set; } + /// <summary> + /// Gets or sets the user id. + /// </summary> public Guid? UserId { get; protected set; } + /// <summary> + /// Gets or sets the path of the image. + /// </summary> + /// <remarks> + /// Required. + /// </remarks> [Required] [MaxLength(512)] [StringLength(512)] public string Path { get; set; } - [Required] + /// <summary> + /// Gets or sets the date last modified. + /// </summary> + /// <remarks> + /// Required. + /// </remarks> public DateTime LastModified { get; set; } } } diff --git a/Jellyfin.Data/Entities/ItemDisplayPreferences.cs b/Jellyfin.Data/Entities/ItemDisplayPreferences.cs index 023cdc740..d81e4a31c 100644 --- a/Jellyfin.Data/Entities/ItemDisplayPreferences.cs +++ b/Jellyfin.Data/Entities/ItemDisplayPreferences.cs @@ -1,12 +1,13 @@ -#pragma warning disable CS1591 - -using System; +using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Jellyfin.Data.Enums; namespace Jellyfin.Data.Entities { + /// <summary> + /// An entity that represents a user's display preferences for a specific item. + /// </summary> public class ItemDisplayPreferences { /// <summary> diff --git a/Jellyfin.Data/Entities/Libraries/Artwork.cs b/Jellyfin.Data/Entities/Libraries/Artwork.cs index 7be22af25..06cd33330 100644 --- a/Jellyfin.Data/Entities/Libraries/Artwork.cs +++ b/Jellyfin.Data/Entities/Libraries/Artwork.cs @@ -1,3 +1,5 @@ +#pragma warning disable CA2227 + using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/Jellyfin.Data/Entities/Libraries/Book.cs b/Jellyfin.Data/Entities/Libraries/Book.cs index 8337788dd..2e63f75bd 100644 --- a/Jellyfin.Data/Entities/Libraries/Book.cs +++ b/Jellyfin.Data/Entities/Libraries/Book.cs @@ -1,3 +1,5 @@ +#pragma warning disable CA2227 + using System.Collections.Generic; using Jellyfin.Data.Interfaces; diff --git a/Jellyfin.Data/Entities/Libraries/BookMetadata.cs b/Jellyfin.Data/Entities/Libraries/BookMetadata.cs index bd716712b..4a3d290f0 100644 --- a/Jellyfin.Data/Entities/Libraries/BookMetadata.cs +++ b/Jellyfin.Data/Entities/Libraries/BookMetadata.cs @@ -1,3 +1,5 @@ +#pragma warning disable CA2227 + using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; @@ -8,7 +10,7 @@ namespace Jellyfin.Data.Entities.Libraries /// <summary> /// An entity containing metadata for a book. /// </summary> - public class BookMetadata : Metadata, IHasCompanies + public class BookMetadata : ItemMetadata, IHasCompanies { /// <summary> /// Initializes a new instance of the <see cref="BookMetadata"/> class. diff --git a/Jellyfin.Data/Entities/Libraries/Chapter.cs b/Jellyfin.Data/Entities/Libraries/Chapter.cs index d9293c3cc..f503de379 100644 --- a/Jellyfin.Data/Entities/Libraries/Chapter.cs +++ b/Jellyfin.Data/Entities/Libraries/Chapter.cs @@ -1,3 +1,5 @@ +#pragma warning disable CA2227 + using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/Jellyfin.Data/Entities/Libraries/Collection.cs b/Jellyfin.Data/Entities/Libraries/Collection.cs index 2e1bbcfb6..39eded752 100644 --- a/Jellyfin.Data/Entities/Libraries/Collection.cs +++ b/Jellyfin.Data/Entities/Libraries/Collection.cs @@ -1,3 +1,5 @@ +#pragma warning disable CA2227 + using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/Jellyfin.Data/Entities/Libraries/CollectionItem.cs b/Jellyfin.Data/Entities/Libraries/CollectionItem.cs index c9306f630..4467c9bbd 100644 --- a/Jellyfin.Data/Entities/Libraries/CollectionItem.cs +++ b/Jellyfin.Data/Entities/Libraries/CollectionItem.cs @@ -73,7 +73,7 @@ namespace Jellyfin.Data.Entities.Libraries /// Gets or sets the next item in the collection. /// </summary> /// <remarks> - /// TODO check if this properly updated dependant and has the proper principal relationship + /// TODO check if this properly updated dependant and has the proper principal relationship. /// </remarks> public virtual CollectionItem Next { get; set; } @@ -81,7 +81,7 @@ namespace Jellyfin.Data.Entities.Libraries /// Gets or sets the previous item in the collection. /// </summary> /// <remarks> - /// TODO check if this properly updated dependant and has the proper principal relationship + /// TODO check if this properly updated dependant and has the proper principal relationship. /// </remarks> public virtual CollectionItem Previous { get; set; } diff --git a/Jellyfin.Data/Entities/Libraries/Company.cs b/Jellyfin.Data/Entities/Libraries/Company.cs index 02da26bc2..3b6ed3309 100644 --- a/Jellyfin.Data/Entities/Libraries/Company.cs +++ b/Jellyfin.Data/Entities/Libraries/Company.cs @@ -1,3 +1,5 @@ +#pragma warning disable CA2227 + using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/Jellyfin.Data/Entities/Libraries/CompanyMetadata.cs b/Jellyfin.Data/Entities/Libraries/CompanyMetadata.cs index 60cc96a34..8aa0486af 100644 --- a/Jellyfin.Data/Entities/Libraries/CompanyMetadata.cs +++ b/Jellyfin.Data/Entities/Libraries/CompanyMetadata.cs @@ -6,7 +6,7 @@ namespace Jellyfin.Data.Entities.Libraries /// <summary> /// An entity holding metadata for a <see cref="Company"/>. /// </summary> - public class CompanyMetadata : Metadata + public class CompanyMetadata : ItemMetadata { /// <summary> /// Initializes a new instance of the <see cref="CompanyMetadata"/> class. diff --git a/Jellyfin.Data/Entities/Libraries/CustomItem.cs b/Jellyfin.Data/Entities/Libraries/CustomItem.cs index 6a4f0a537..115489c78 100644 --- a/Jellyfin.Data/Entities/Libraries/CustomItem.cs +++ b/Jellyfin.Data/Entities/Libraries/CustomItem.cs @@ -1,3 +1,5 @@ +#pragma warning disable CA2227 + using System.Collections.Generic; using Jellyfin.Data.Interfaces; diff --git a/Jellyfin.Data/Entities/Libraries/CustomItemMetadata.cs b/Jellyfin.Data/Entities/Libraries/CustomItemMetadata.cs index bc1835528..f0daedfbe 100644 --- a/Jellyfin.Data/Entities/Libraries/CustomItemMetadata.cs +++ b/Jellyfin.Data/Entities/Libraries/CustomItemMetadata.cs @@ -5,7 +5,7 @@ namespace Jellyfin.Data.Entities.Libraries /// <summary> /// An entity containing metadata for a custom item. /// </summary> - public class CustomItemMetadata : Metadata + public class CustomItemMetadata : ItemMetadata { /// <summary> /// Initializes a new instance of the <see cref="CustomItemMetadata"/> class. diff --git a/Jellyfin.Data/Entities/Libraries/Episode.cs b/Jellyfin.Data/Entities/Libraries/Episode.cs index 430a11e3c..0bdc2d764 100644 --- a/Jellyfin.Data/Entities/Libraries/Episode.cs +++ b/Jellyfin.Data/Entities/Libraries/Episode.cs @@ -1,3 +1,5 @@ +#pragma warning disable CA2227 + using System; using System.Collections.Generic; using Jellyfin.Data.Interfaces; diff --git a/Jellyfin.Data/Entities/Libraries/EpisodeMetadata.cs b/Jellyfin.Data/Entities/Libraries/EpisodeMetadata.cs index 348100cb4..7efb840f0 100644 --- a/Jellyfin.Data/Entities/Libraries/EpisodeMetadata.cs +++ b/Jellyfin.Data/Entities/Libraries/EpisodeMetadata.cs @@ -6,7 +6,7 @@ namespace Jellyfin.Data.Entities.Libraries /// <summary> /// An entity containing metadata for an <see cref="Episode"/>. /// </summary> - public class EpisodeMetadata : Metadata + public class EpisodeMetadata : ItemMetadata { /// <summary> /// Initializes a new instance of the <see cref="EpisodeMetadata"/> class. diff --git a/Jellyfin.Data/Entities/Libraries/Genre.cs b/Jellyfin.Data/Entities/Libraries/Genre.cs index aeedd7bfd..2a2dbd1a5 100644 --- a/Jellyfin.Data/Entities/Libraries/Genre.cs +++ b/Jellyfin.Data/Entities/Libraries/Genre.cs @@ -14,8 +14,8 @@ namespace Jellyfin.Data.Entities.Libraries /// Initializes a new instance of the <see cref="Genre"/> class. /// </summary> /// <param name="name">The name.</param> - /// <param name="metadata">The metadata.</param> - public Genre(string name, Metadata metadata) + /// <param name="itemMetadata">The metadata.</param> + public Genre(string name, ItemMetadata itemMetadata) { if (string.IsNullOrEmpty(name)) { @@ -24,12 +24,12 @@ namespace Jellyfin.Data.Entities.Libraries Name = name; - if (metadata == null) + if (itemMetadata == null) { - throw new ArgumentNullException(nameof(metadata)); + throw new ArgumentNullException(nameof(itemMetadata)); } - metadata.Genres.Add(this); + itemMetadata.Genres.Add(this); } /// <summary> diff --git a/Jellyfin.Data/Entities/Libraries/Metadata.cs b/Jellyfin.Data/Entities/Libraries/ItemMetadata.cs index 877bb5fbd..1d2dc0f66 100644 --- a/Jellyfin.Data/Entities/Libraries/Metadata.cs +++ b/Jellyfin.Data/Entities/Libraries/ItemMetadata.cs @@ -1,3 +1,5 @@ +#pragma warning disable CA2227 + using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -9,14 +11,14 @@ namespace Jellyfin.Data.Entities.Libraries /// <summary> /// An abstract class that holds metadata. /// </summary> - public abstract class Metadata : IHasArtwork, IHasConcurrencyToken + public abstract class ItemMetadata : IHasArtwork, IHasConcurrencyToken { /// <summary> - /// Initializes a new instance of the <see cref="Metadata"/> class. + /// Initializes a new instance of the <see cref="ItemMetadata"/> class. /// </summary> /// <param name="title">The title or name of the object.</param> /// <param name="language">ISO-639-3 3-character language codes.</param> - protected Metadata(string title, string language) + protected ItemMetadata(string title, string language) { if (string.IsNullOrEmpty(title)) { @@ -41,12 +43,12 @@ namespace Jellyfin.Data.Entities.Libraries } /// <summary> - /// Initializes a new instance of the <see cref="Metadata"/> class. + /// Initializes a new instance of the <see cref="ItemMetadata"/> class. /// </summary> /// <remarks> /// Default constructor. Protected due to being abstract. /// </remarks> - protected Metadata() + protected ItemMetadata() { } diff --git a/Jellyfin.Data/Entities/Libraries/MediaFile.cs b/Jellyfin.Data/Entities/Libraries/MediaFile.cs index 8bc649c98..9924d5728 100644 --- a/Jellyfin.Data/Entities/Libraries/MediaFile.cs +++ b/Jellyfin.Data/Entities/Libraries/MediaFile.cs @@ -1,3 +1,5 @@ +#pragma warning disable CA2227 + using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; diff --git a/Jellyfin.Data/Entities/Libraries/MetadataProviderId.cs b/Jellyfin.Data/Entities/Libraries/MetadataProviderId.cs index 6e6de598e..fcfb35bfa 100644 --- a/Jellyfin.Data/Entities/Libraries/MetadataProviderId.cs +++ b/Jellyfin.Data/Entities/Libraries/MetadataProviderId.cs @@ -14,8 +14,8 @@ namespace Jellyfin.Data.Entities.Libraries /// Initializes a new instance of the <see cref="MetadataProviderId"/> class. /// </summary> /// <param name="providerId">The provider id.</param> - /// <param name="metadata">The metadata entity.</param> - public MetadataProviderId(string providerId, Metadata metadata) + /// <param name="itemMetadata">The metadata entity.</param> + public MetadataProviderId(string providerId, ItemMetadata itemMetadata) { if (string.IsNullOrEmpty(providerId)) { @@ -24,12 +24,12 @@ namespace Jellyfin.Data.Entities.Libraries ProviderId = providerId; - if (metadata == null) + if (itemMetadata == null) { - throw new ArgumentNullException(nameof(metadata)); + throw new ArgumentNullException(nameof(itemMetadata)); } - metadata.Sources.Add(this); + itemMetadata.Sources.Add(this); } /// <summary> diff --git a/Jellyfin.Data/Entities/Libraries/Movie.cs b/Jellyfin.Data/Entities/Libraries/Movie.cs index 0a8cc83dd..08db904fa 100644 --- a/Jellyfin.Data/Entities/Libraries/Movie.cs +++ b/Jellyfin.Data/Entities/Libraries/Movie.cs @@ -1,3 +1,5 @@ +#pragma warning disable CA2227 + using System.Collections.Generic; using Jellyfin.Data.Interfaces; diff --git a/Jellyfin.Data/Entities/Libraries/MovieMetadata.cs b/Jellyfin.Data/Entities/Libraries/MovieMetadata.cs index 31102bf13..aa1501a5c 100644 --- a/Jellyfin.Data/Entities/Libraries/MovieMetadata.cs +++ b/Jellyfin.Data/Entities/Libraries/MovieMetadata.cs @@ -1,3 +1,5 @@ +#pragma warning disable CA2227 + using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; @@ -8,7 +10,7 @@ namespace Jellyfin.Data.Entities.Libraries /// <summary> /// An entity holding the metadata for a movie. /// </summary> - public class MovieMetadata : Metadata, IHasCompanies + public class MovieMetadata : ItemMetadata, IHasCompanies { /// <summary> /// Initializes a new instance of the <see cref="MovieMetadata"/> class. diff --git a/Jellyfin.Data/Entities/Libraries/MusicAlbum.cs b/Jellyfin.Data/Entities/Libraries/MusicAlbum.cs index 2ed1f78c5..06aff6f45 100644 --- a/Jellyfin.Data/Entities/Libraries/MusicAlbum.cs +++ b/Jellyfin.Data/Entities/Libraries/MusicAlbum.cs @@ -1,3 +1,5 @@ +#pragma warning disable CA2227 + using System.Collections.Generic; namespace Jellyfin.Data.Entities.Libraries diff --git a/Jellyfin.Data/Entities/Libraries/MusicAlbumMetadata.cs b/Jellyfin.Data/Entities/Libraries/MusicAlbumMetadata.cs index cc5919bfe..05c0b0374 100644 --- a/Jellyfin.Data/Entities/Libraries/MusicAlbumMetadata.cs +++ b/Jellyfin.Data/Entities/Libraries/MusicAlbumMetadata.cs @@ -1,3 +1,5 @@ +#pragma warning disable CA2227 + using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -6,7 +8,7 @@ namespace Jellyfin.Data.Entities.Libraries /// <summary> /// An entity holding the metadata for a music album. /// </summary> - public class MusicAlbumMetadata : Metadata + public class MusicAlbumMetadata : ItemMetadata { /// <summary> /// Initializes a new instance of the <see cref="MusicAlbumMetadata"/> class. diff --git a/Jellyfin.Data/Entities/Libraries/Person.cs b/Jellyfin.Data/Entities/Libraries/Person.cs index 8beb3dd08..af4c87b73 100644 --- a/Jellyfin.Data/Entities/Libraries/Person.cs +++ b/Jellyfin.Data/Entities/Libraries/Person.cs @@ -1,3 +1,5 @@ +#pragma warning disable CA2227 + using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; diff --git a/Jellyfin.Data/Entities/Libraries/PersonRole.cs b/Jellyfin.Data/Entities/Libraries/PersonRole.cs index 5290228d6..cd38ee83d 100644 --- a/Jellyfin.Data/Entities/Libraries/PersonRole.cs +++ b/Jellyfin.Data/Entities/Libraries/PersonRole.cs @@ -1,3 +1,5 @@ +#pragma warning disable CA2227 + using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -16,17 +18,17 @@ namespace Jellyfin.Data.Entities.Libraries /// Initializes a new instance of the <see cref="PersonRole"/> class. /// </summary> /// <param name="type">The role type.</param> - /// <param name="metadata">The metadata.</param> - public PersonRole(PersonRoleType type, Metadata metadata) + /// <param name="itemMetadata">The metadata.</param> + public PersonRole(PersonRoleType type, ItemMetadata itemMetadata) { Type = type; - if (metadata == null) + if (itemMetadata == null) { - throw new ArgumentNullException(nameof(metadata)); + throw new ArgumentNullException(nameof(itemMetadata)); } - metadata.PersonRoles.Add(this); + itemMetadata.PersonRoles.Add(this); Sources = new HashSet<MetadataProviderId>(); } diff --git a/Jellyfin.Data/Entities/Libraries/Photo.cs b/Jellyfin.Data/Entities/Libraries/Photo.cs index 44338a4ce..25562ec96 100644 --- a/Jellyfin.Data/Entities/Libraries/Photo.cs +++ b/Jellyfin.Data/Entities/Libraries/Photo.cs @@ -1,3 +1,5 @@ +#pragma warning disable CA2227 + using System.Collections.Generic; using Jellyfin.Data.Interfaces; diff --git a/Jellyfin.Data/Entities/Libraries/PhotoMetadata.cs b/Jellyfin.Data/Entities/Libraries/PhotoMetadata.cs index 1ef9dd5f9..ffc790b57 100644 --- a/Jellyfin.Data/Entities/Libraries/PhotoMetadata.cs +++ b/Jellyfin.Data/Entities/Libraries/PhotoMetadata.cs @@ -5,7 +5,7 @@ namespace Jellyfin.Data.Entities.Libraries /// <summary> /// An entity that holds metadata for a photo. /// </summary> - public class PhotoMetadata : Metadata + public class PhotoMetadata : ItemMetadata { /// <summary> /// Initializes a new instance of the <see cref="PhotoMetadata"/> class. diff --git a/Jellyfin.Data/Entities/Libraries/Rating.cs b/Jellyfin.Data/Entities/Libraries/Rating.cs index ba054a39e..98226cd80 100644 --- a/Jellyfin.Data/Entities/Libraries/Rating.cs +++ b/Jellyfin.Data/Entities/Libraries/Rating.cs @@ -14,17 +14,17 @@ namespace Jellyfin.Data.Entities.Libraries /// Initializes a new instance of the <see cref="Rating"/> class. /// </summary> /// <param name="value">The value.</param> - /// <param name="metadata">The metadata.</param> - public Rating(double value, Metadata metadata) + /// <param name="itemMetadata">The metadata.</param> + public Rating(double value, ItemMetadata itemMetadata) { Value = value; - if (metadata == null) + if (itemMetadata == null) { - throw new ArgumentNullException(nameof(metadata)); + throw new ArgumentNullException(nameof(itemMetadata)); } - metadata.Ratings.Add(this); + itemMetadata.Ratings.Add(this); } /// <summary> diff --git a/Jellyfin.Data/Entities/Libraries/Release.cs b/Jellyfin.Data/Entities/Libraries/Release.cs index 43c7080d7..b633e08fb 100644 --- a/Jellyfin.Data/Entities/Libraries/Release.cs +++ b/Jellyfin.Data/Entities/Libraries/Release.cs @@ -1,3 +1,5 @@ +#pragma warning disable CA2227 + using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; diff --git a/Jellyfin.Data/Entities/Libraries/Season.cs b/Jellyfin.Data/Entities/Libraries/Season.cs index eef788bad..eb6674dbc 100644 --- a/Jellyfin.Data/Entities/Libraries/Season.cs +++ b/Jellyfin.Data/Entities/Libraries/Season.cs @@ -1,3 +1,5 @@ +#pragma warning disable CA2227 + using System; using System.Collections.Generic; diff --git a/Jellyfin.Data/Entities/Libraries/SeasonMetadata.cs b/Jellyfin.Data/Entities/Libraries/SeasonMetadata.cs index eedeb089e..7ce79756b 100644 --- a/Jellyfin.Data/Entities/Libraries/SeasonMetadata.cs +++ b/Jellyfin.Data/Entities/Libraries/SeasonMetadata.cs @@ -6,7 +6,7 @@ namespace Jellyfin.Data.Entities.Libraries /// <summary> /// An entity that holds metadata for seasons. /// </summary> - public class SeasonMetadata : Metadata + public class SeasonMetadata : ItemMetadata { /// <summary> /// Initializes a new instance of the <see cref="SeasonMetadata"/> class. diff --git a/Jellyfin.Data/Entities/Libraries/Series.cs b/Jellyfin.Data/Entities/Libraries/Series.cs index e959c1fe0..8c8317d14 100644 --- a/Jellyfin.Data/Entities/Libraries/Series.cs +++ b/Jellyfin.Data/Entities/Libraries/Series.cs @@ -1,3 +1,5 @@ +#pragma warning disable CA2227 + using System; using System.Collections.Generic; diff --git a/Jellyfin.Data/Entities/Libraries/SeriesMetadata.cs b/Jellyfin.Data/Entities/Libraries/SeriesMetadata.cs index 898f3006d..877dbfc69 100644 --- a/Jellyfin.Data/Entities/Libraries/SeriesMetadata.cs +++ b/Jellyfin.Data/Entities/Libraries/SeriesMetadata.cs @@ -1,3 +1,5 @@ +#pragma warning disable CA2227 + using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -9,7 +11,7 @@ namespace Jellyfin.Data.Entities.Libraries /// <summary> /// An entity representing series metadata. /// </summary> - public class SeriesMetadata : Metadata, IHasCompanies + public class SeriesMetadata : ItemMetadata, IHasCompanies { /// <summary> /// Initializes a new instance of the <see cref="SeriesMetadata"/> class. diff --git a/Jellyfin.Data/Entities/Libraries/Track.cs b/Jellyfin.Data/Entities/Libraries/Track.cs index 09ce82a9b..782bfb5ce 100644 --- a/Jellyfin.Data/Entities/Libraries/Track.cs +++ b/Jellyfin.Data/Entities/Libraries/Track.cs @@ -1,3 +1,5 @@ +#pragma warning disable CA2227 + using System; using System.Collections.Generic; using Jellyfin.Data.Interfaces; diff --git a/Jellyfin.Data/Entities/Libraries/TrackMetadata.cs b/Jellyfin.Data/Entities/Libraries/TrackMetadata.cs index 048068a1a..321f93bf2 100644 --- a/Jellyfin.Data/Entities/Libraries/TrackMetadata.cs +++ b/Jellyfin.Data/Entities/Libraries/TrackMetadata.cs @@ -5,7 +5,7 @@ namespace Jellyfin.Data.Entities.Libraries /// <summary> /// An entity holding metadata for a track. /// </summary> - public class TrackMetadata : Metadata + public class TrackMetadata : ItemMetadata { /// <summary> /// Initializes a new instance of the <see cref="TrackMetadata"/> class. diff --git a/Jellyfin.Data/Entities/Permission.cs b/Jellyfin.Data/Entities/Permission.cs index c0f67f836..d92e5d9d2 100644 --- a/Jellyfin.Data/Entities/Permission.cs +++ b/Jellyfin.Data/Entities/Permission.cs @@ -1,5 +1,3 @@ -#pragma warning disable CS1591 - using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Jellyfin.Data.Enums; @@ -10,7 +8,7 @@ namespace Jellyfin.Data.Entities /// <summary> /// An entity representing whether the associated user has a specific permission. /// </summary> - public partial class Permission : IHasConcurrencyToken + public class Permission : IHasConcurrencyToken { /// <summary> /// Initializes a new instance of the <see cref="Permission"/> class. @@ -22,8 +20,6 @@ namespace Jellyfin.Data.Entities { Kind = kind; Value = value; - - Init(); } /// <summary> @@ -32,21 +28,14 @@ namespace Jellyfin.Data.Entities /// </summary> protected Permission() { - Init(); } - /************************************************************************* - * Properties - *************************************************************************/ - /// <summary> /// Gets or sets the id of this permission. /// </summary> /// <remarks> /// Identity, Indexed, Required. /// </remarks> - [Key] - [Required] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int Id { get; protected set; } @@ -56,7 +45,6 @@ namespace Jellyfin.Data.Entities /// <remarks> /// Required. /// </remarks> - [Required] public PermissionKind Kind { get; protected set; } /// <summary> @@ -65,36 +53,16 @@ namespace Jellyfin.Data.Entities /// <remarks> /// Required. /// </remarks> - [Required] public bool Value { get; set; } - /// <summary> - /// Gets or sets the row version. - /// </summary> - /// <remarks> - /// Required, ConcurrencyToken. - /// </remarks> + /// <inheritdoc /> [ConcurrencyCheck] - [Required] public uint RowVersion { get; set; } - /// <summary> - /// Static create function (for use in LINQ queries, etc.) - /// </summary> - /// <param name="kind">The permission kind.</param> - /// <param name="value">The value of this permission.</param> - /// <returns>The newly created instance.</returns> - public static Permission Create(PermissionKind kind, bool value) - { - return new Permission(kind, value); - } - /// <inheritdoc/> public void OnSavingChanges() { RowVersion++; } - - partial void Init(); } } diff --git a/Jellyfin.Data/Entities/Preference.cs b/Jellyfin.Data/Entities/Preference.cs index 1797f0a40..4efddf2a4 100644 --- a/Jellyfin.Data/Entities/Preference.cs +++ b/Jellyfin.Data/Entities/Preference.cs @@ -31,18 +31,12 @@ namespace Jellyfin.Data.Entities { } - /************************************************************************* - * Properties - *************************************************************************/ - /// <summary> /// Gets or sets the id of this preference. /// </summary> /// <remarks> /// Identity, Indexed, Required. /// </remarks> - [Key] - [Required] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int Id { get; protected set; } @@ -52,7 +46,6 @@ namespace Jellyfin.Data.Entities /// <remarks> /// Required. /// </remarks> - [Required] public PreferenceKind Kind { get; protected set; } /// <summary> @@ -66,27 +59,10 @@ namespace Jellyfin.Data.Entities [StringLength(65535)] public string Value { get; set; } - /// <summary> - /// Gets or sets the row version. - /// </summary> - /// <remarks> - /// Required, ConcurrencyToken. - /// </remarks> + /// <inheritdoc/> [ConcurrencyCheck] - [Required] public uint RowVersion { get; set; } - /// <summary> - /// Static create function (for use in LINQ queries, etc.) - /// </summary> - /// <param name="kind">The preference kind.</param> - /// <param name="value">The value.</param> - /// <returns>The new instance.</returns> - public static Preference Create(PreferenceKind kind, string value) - { - return new Preference(kind, value); - } - /// <inheritdoc/> public void OnSavingChanges() { diff --git a/Jellyfin.Data/Entities/ProviderMapping.cs b/Jellyfin.Data/Entities/ProviderMapping.cs deleted file mode 100644 index 44ebfba76..000000000 --- a/Jellyfin.Data/Entities/ProviderMapping.cs +++ /dev/null @@ -1,129 +0,0 @@ -#pragma warning disable CS1591 - -using System; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Jellyfin.Data.Entities -{ - public partial class ProviderMapping - { - partial void Init(); - - /// <summary> - /// Default constructor. Protected due to required properties, but present because EF needs it. - /// </summary> - protected ProviderMapping() - { - Init(); - } - - /// <summary> - /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving. - /// </summary> - public static ProviderMapping CreateProviderMappingUnsafe() - { - return new ProviderMapping(); - } - - /// <summary> - /// Public constructor with required data. - /// </summary> - /// <param name="providername"></param> - /// <param name="providersecrets"></param> - /// <param name="providerdata"></param> - /// <param name="_user0"></param> - /// <param name="_group1"></param> - public ProviderMapping(string providername, string providersecrets, string providerdata, User _user0, Group _group1) - { - if (string.IsNullOrEmpty(providername)) - { - throw new ArgumentNullException(nameof(providername)); - } - - this.ProviderName = providername; - - if (string.IsNullOrEmpty(providersecrets)) - { - throw new ArgumentNullException(nameof(providersecrets)); - } - - this.ProviderSecrets = providersecrets; - - if (string.IsNullOrEmpty(providerdata)) - { - throw new ArgumentNullException(nameof(providerdata)); - } - - this.ProviderData = providerdata; - - Init(); - } - - /// <summary> - /// Static create function (for use in LINQ queries, etc.) - /// </summary> - /// <param name="providername"></param> - /// <param name="providersecrets"></param> - /// <param name="providerdata"></param> - /// <param name="_user0"></param> - /// <param name="_group1"></param> - public static ProviderMapping Create(string providername, string providersecrets, string providerdata, User _user0, Group _group1) - { - return new ProviderMapping(providername, providersecrets, providerdata, _user0, _group1); - } - - /************************************************************************* - * Properties - *************************************************************************/ - - /// <summary> - /// Identity, Indexed, Required. - /// </summary> - [Key] - [Required] - [DatabaseGenerated(DatabaseGeneratedOption.Identity)] - public int Id { get; protected set; } - - /// <summary> - /// Required, Max length = 255 - /// </summary> - [Required] - [MaxLength(255)] - [StringLength(255)] - public string ProviderName { get; set; } - - /// <summary> - /// Required, Max length = 65535 - /// </summary> - [Required] - [MaxLength(65535)] - [StringLength(65535)] - public string ProviderSecrets { get; set; } - - /// <summary> - /// Required, Max length = 65535 - /// </summary> - [Required] - [MaxLength(65535)] - [StringLength(65535)] - public string ProviderData { get; set; } - - /// <summary> - /// Required, ConcurrenyToken. - /// </summary> - [ConcurrencyCheck] - [Required] - public uint RowVersion { get; set; } - - public void OnSavingChanges() - { - RowVersion++; - } - - /************************************************************************* - * Navigation properties - *************************************************************************/ - } -} - diff --git a/Jellyfin.Data/Entities/User.cs b/Jellyfin.Data/Entities/User.cs index 7ea1f4498..f7ab57a1b 100644 --- a/Jellyfin.Data/Entities/User.cs +++ b/Jellyfin.Data/Entities/User.cs @@ -1,4 +1,4 @@ -#pragma warning disable CS1591 +#pragma warning disable CA2227 using System; using System.Collections.Generic; @@ -15,7 +15,7 @@ namespace Jellyfin.Data.Entities /// <summary> /// An entity representing a user. /// </summary> - public partial class User : IHasPermissions, IHasConcurrencyToken + public class User : IHasPermissions, IHasConcurrencyToken { /// <summary> /// The values being delimited here are Guids, so commas work as they do not appear in Guids. @@ -75,7 +75,6 @@ namespace Jellyfin.Data.Entities AddDefaultPermissions(); AddDefaultPreferences(); - Init(); } /// <summary> @@ -84,21 +83,14 @@ namespace Jellyfin.Data.Entities /// </summary> protected User() { - Init(); } - /************************************************************************* - * Properties - *************************************************************************/ - /// <summary> /// Gets or sets the Id of the user. /// </summary> /// <remarks> /// Identity, Indexed, Required. /// </remarks> - [Key] - [Required] [JsonIgnore] public Guid Id { get; set; } @@ -139,7 +131,6 @@ namespace Jellyfin.Data.Entities /// <remarks> /// Required. /// </remarks> - [Required] public bool MustUpdatePassword { get; set; } /// <summary> @@ -180,7 +171,6 @@ namespace Jellyfin.Data.Entities /// <remarks> /// Required. /// </remarks> - [Required] public int InvalidLoginAttemptCount { get; set; } /// <summary> @@ -204,7 +194,6 @@ namespace Jellyfin.Data.Entities /// <remarks> /// Required. /// </remarks> - [Required] public SubtitlePlaybackMode SubtitleMode { get; set; } /// <summary> @@ -213,7 +202,6 @@ namespace Jellyfin.Data.Entities /// <remarks> /// Required. /// </remarks> - [Required] public bool PlayDefaultAudioTrack { get; set; } /// <summary> @@ -232,7 +220,6 @@ namespace Jellyfin.Data.Entities /// <remarks> /// Required. /// </remarks> - [Required] public bool DisplayMissingEpisodes { get; set; } /// <summary> @@ -241,7 +228,6 @@ namespace Jellyfin.Data.Entities /// <remarks> /// Required. /// </remarks> - [Required] public bool DisplayCollectionsView { get; set; } /// <summary> @@ -250,7 +236,6 @@ namespace Jellyfin.Data.Entities /// <remarks> /// Required. /// </remarks> - [Required] public bool EnableLocalPassword { get; set; } /// <summary> @@ -259,7 +244,6 @@ namespace Jellyfin.Data.Entities /// <remarks> /// Required. /// </remarks> - [Required] public bool HidePlayedInLatest { get; set; } /// <summary> @@ -268,7 +252,6 @@ namespace Jellyfin.Data.Entities /// <remarks> /// Required. /// </remarks> - [Required] public bool RememberAudioSelections { get; set; } /// <summary> @@ -277,7 +260,6 @@ namespace Jellyfin.Data.Entities /// <remarks> /// Required. /// </remarks> - [Required] public bool RememberSubtitleSelections { get; set; } /// <summary> @@ -286,7 +268,6 @@ namespace Jellyfin.Data.Entities /// <remarks> /// Required. /// </remarks> - [Required] public bool EnableNextEpisodeAutoPlay { get; set; } /// <summary> @@ -295,7 +276,6 @@ namespace Jellyfin.Data.Entities /// <remarks> /// Required. /// </remarks> - [Required] public bool EnableAutoLogin { get; set; } /// <summary> @@ -304,7 +284,6 @@ namespace Jellyfin.Data.Entities /// <remarks> /// Required. /// </remarks> - [Required] public bool EnableUserPreferenceAccess { get; set; } /// <summary> @@ -322,7 +301,6 @@ namespace Jellyfin.Data.Entities /// This is a temporary stopgap for until the library db is migrated. /// This corresponds to the value of the index of this user in the library db. /// </summary> - [Required] public long InternalId { get; set; } /// <summary> @@ -340,7 +318,9 @@ namespace Jellyfin.Data.Entities [Required] public virtual DisplayPreferences DisplayPreferences { get; set; } - [Required] + /// <summary> + /// Gets or sets the level of sync play permissions this user has. + /// </summary> public SyncPlayAccess SyncPlayAccess { get; set; } /// <summary> @@ -350,13 +330,8 @@ namespace Jellyfin.Data.Entities /// Required, Concurrency Token. /// </remarks> [ConcurrencyCheck] - [Required] public uint RowVersion { get; set; } - /************************************************************************* - * Navigation properties - *************************************************************************/ - /// <summary> /// Gets or sets the list of access schedules this user has. /// </summary> @@ -395,18 +370,6 @@ namespace Jellyfin.Data.Entities [ForeignKey("Preference_Preferences_Guid")] public virtual ICollection<Preference> Preferences { get; protected set; } - /// <summary> - /// Static create function (for use in LINQ queries, etc.) - /// </summary> - /// <param name="username">The username for the created user.</param> - /// <param name="authenticationProviderId">The Id of the user's authentication provider.</param> - /// <param name="passwordResetProviderId">The Id of the user's password reset provider.</param> - /// <returns>The created instance.</returns> - public static User Create(string username, string authenticationProviderId, string passwordResetProviderId) - { - return new User(username, authenticationProviderId, passwordResetProviderId); - } - /// <inheritdoc/> public void OnSavingChanges() { @@ -519,7 +482,5 @@ namespace Jellyfin.Data.Entities Preferences.Add(new Preference(val, string.Empty)); } } - - partial void Init(); } } diff --git a/Jellyfin.Data/Enums/ArtKind.cs b/Jellyfin.Data/Enums/ArtKind.cs index 71b4db6f2..f7a73848c 100644 --- a/Jellyfin.Data/Enums/ArtKind.cs +++ b/Jellyfin.Data/Enums/ArtKind.cs @@ -1,13 +1,33 @@ -#pragma warning disable CS1591 - namespace Jellyfin.Data.Enums { + /// <summary> + /// An enum representing types of art. + /// </summary> public enum ArtKind { - Other, - Poster, - Banner, - Thumbnail, - Logo + /// <summary> + /// Another type of art, not covered by the other members. + /// </summary> + Other = 0, + + /// <summary> + /// A poster. + /// </summary> + Poster = 1, + + /// <summary> + /// A banner. + /// </summary> + Banner = 2, + + /// <summary> + /// A thumbnail. + /// </summary> + Thumbnail = 3, + + /// <summary> + /// A logo. + /// </summary> + Logo = 4 } } diff --git a/Jellyfin.Data/Enums/DynamicDayOfWeek.cs b/Jellyfin.Data/Enums/DynamicDayOfWeek.cs index a33cd9d1c..d3d8dd822 100644 --- a/Jellyfin.Data/Enums/DynamicDayOfWeek.cs +++ b/Jellyfin.Data/Enums/DynamicDayOfWeek.cs @@ -1,18 +1,58 @@ -#pragma warning disable CS1591 - namespace Jellyfin.Data.Enums { + /// <summary> + /// An enum that represents a day of the week, weekdays, weekends, or all days. + /// </summary> public enum DynamicDayOfWeek { + /// <summary> + /// Sunday. + /// </summary> Sunday = 0, + + /// <summary> + /// Monday. + /// </summary> Monday = 1, + + /// <summary> + /// Tuesday. + /// </summary> Tuesday = 2, + + /// <summary> + /// Wednesday. + /// </summary> Wednesday = 3, + + /// <summary> + /// Thursday. + /// </summary> Thursday = 4, + + /// <summary> + /// Friday. + /// </summary> Friday = 5, + + /// <summary> + /// Saturday. + /// </summary> Saturday = 6, + + /// <summary> + /// All days of the week. + /// </summary> Everyday = 7, + + /// <summary> + /// A week day, or Monday-Friday. + /// </summary> Weekday = 8, + + /// <summary> + /// Saturday and Sunday. + /// </summary> Weekend = 9 } } diff --git a/Jellyfin.Data/Enums/IndexingKind.cs b/Jellyfin.Data/Enums/IndexingKind.cs index fafe47e0c..c0df07714 100644 --- a/Jellyfin.Data/Enums/IndexingKind.cs +++ b/Jellyfin.Data/Enums/IndexingKind.cs @@ -1,7 +1,8 @@ -#pragma warning disable CS1591 - -namespace Jellyfin.Data.Enums +namespace Jellyfin.Data.Enums { + /// <summary> + /// An enum representing a type of indexing in a user's display preferences. + /// </summary> public enum IndexingKind { /// <summary> diff --git a/Jellyfin.Data/Enums/MediaFileKind.cs b/Jellyfin.Data/Enums/MediaFileKind.cs index b03591fb8..797c26ec2 100644 --- a/Jellyfin.Data/Enums/MediaFileKind.cs +++ b/Jellyfin.Data/Enums/MediaFileKind.cs @@ -1,13 +1,33 @@ -#pragma warning disable CS1591 - namespace Jellyfin.Data.Enums { + /// <summary> + /// An enum representing the type of media file. + /// </summary> public enum MediaFileKind { - Main, - Sidecar, - AdditionalPart, - AlternativeFormat, - AdditionalStream + /// <summary> + /// The main file. + /// </summary> + Main = 0, + + /// <summary> + /// A sidecar file. + /// </summary> + Sidecar = 1, + + /// <summary> + /// An additional part to the main file. + /// </summary> + AdditionalPart = 2, + + /// <summary> + /// An alternative format to the main file. + /// </summary> + AlternativeFormat = 3, + + /// <summary> + /// An additional stream for the main file. + /// </summary> + AdditionalStream = 4 } } diff --git a/Jellyfin.Data/Enums/PersonRoleType.cs b/Jellyfin.Data/Enums/PersonRoleType.cs index 2d80eaa4c..1e619f5ee 100644 --- a/Jellyfin.Data/Enums/PersonRoleType.cs +++ b/Jellyfin.Data/Enums/PersonRoleType.cs @@ -1,20 +1,68 @@ -#pragma warning disable CS1591 - namespace Jellyfin.Data.Enums { + /// <summary> + /// An enum representing a person's role in a specific media item. + /// </summary> public enum PersonRoleType { - Other, - Director, - Artist, - OriginalArtist, - Actor, - VoiceActor, - Producer, - Remixer, - Conductor, - Composer, - Author, - Editor + /// <summary> + /// Another role, not covered by the other types. + /// </summary> + Other = 0, + + /// <summary> + /// The director of the media. + /// </summary> + Director = 1, + + /// <summary> + /// An artist. + /// </summary> + Artist = 2, + + /// <summary> + /// The original artist. + /// </summary> + OriginalArtist = 3, + + /// <summary> + /// An actor. + /// </summary> + Actor = 4, + + /// <summary> + /// A voice actor. + /// </summary> + VoiceActor = 5, + + /// <summary> + /// A producer. + /// </summary> + Producer = 6, + + /// <summary> + /// A remixer. + /// </summary> + Remixer = 7, + + /// <summary> + /// A conductor. + /// </summary> + Conductor = 8, + + /// <summary> + /// A composer. + /// </summary> + Composer = 9, + + /// <summary> + /// An author. + /// </summary> + Author = 10, + + /// <summary> + /// An editor. + /// </summary> + Editor = 11 } } diff --git a/Jellyfin.Data/Enums/SubtitlePlaybackMode.cs b/Jellyfin.Data/Enums/SubtitlePlaybackMode.cs index c8fc21159..ca41300ed 100644 --- a/Jellyfin.Data/Enums/SubtitlePlaybackMode.cs +++ b/Jellyfin.Data/Enums/SubtitlePlaybackMode.cs @@ -1,13 +1,33 @@ -#pragma warning disable CS1591 - -namespace Jellyfin.Data.Enums +namespace Jellyfin.Data.Enums { + /// <summary> + /// An enum representing a subtitle playback mode. + /// </summary> public enum SubtitlePlaybackMode { + /// <summary> + /// The default subtitle playback mode. + /// </summary> Default = 0, + + /// <summary> + /// Always show subtitles. + /// </summary> Always = 1, + + /// <summary> + /// Only show forced subtitles. + /// </summary> OnlyForced = 2, + + /// <summary> + /// Don't show subtitles. + /// </summary> None = 3, + + /// <summary> + /// Only show subtitles when the current audio stream is in a different language. + /// </summary> Smart = 4 } } diff --git a/Jellyfin.Data/Enums/UnratedItem.cs b/Jellyfin.Data/Enums/UnratedItem.cs index 5259e7739..871794086 100644 --- a/Jellyfin.Data/Enums/UnratedItem.cs +++ b/Jellyfin.Data/Enums/UnratedItem.cs @@ -1,17 +1,53 @@ -#pragma warning disable CS1591 - namespace Jellyfin.Data.Enums { + /// <summary> + /// An enum representing an unrated item. + /// </summary> public enum UnratedItem { - Movie, - Trailer, - Series, - Music, - Book, - LiveTvChannel, - LiveTvProgram, - ChannelContent, - Other + /// <summary> + /// A movie. + /// </summary> + Movie = 0, + + /// <summary> + /// A trailer. + /// </summary> + Trailer = 1, + + /// <summary> + /// A series. + /// </summary> + Series = 2, + + /// <summary> + /// Music. + /// </summary> + Music = 3, + + /// <summary> + /// A book. + /// </summary> + Book = 4, + + /// <summary> + /// A live TV channel + /// </summary> + LiveTvChannel = 5, + + /// <summary> + /// A live TV program. + /// </summary> + LiveTvProgram = 6, + + /// <summary> + /// Channel content. + /// </summary> + ChannelContent = 7, + + /// <summary> + /// Another type, not covered by the other fields. + /// </summary> + Other = 8 } } diff --git a/Jellyfin.Data/Jellyfin.Data.csproj b/Jellyfin.Data/Jellyfin.Data.csproj index 203eeaf3b..95343f91b 100644 --- a/Jellyfin.Data/Jellyfin.Data.csproj +++ b/Jellyfin.Data/Jellyfin.Data.csproj @@ -4,7 +4,7 @@ <TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks> <GenerateAssemblyInfo>false</GenerateAssemblyInfo> <GenerateDocumentationFile>true</GenerateDocumentationFile> - <TreatWarningsAsErrors Condition=" '$(Configuration)' == 'Release' ">true</TreatWarningsAsErrors> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> <PublishRepositoryUrl>true</PublishRepositoryUrl> <EmbedUntrackedSources>true</EmbedUntrackedSources> <IncludeSymbols>true</IncludeSymbols> @@ -45,4 +45,8 @@ <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="3.1.7" /> </ItemGroup> + <ItemGroup> + <Compile Include="..\SharedVersion.cs" /> + </ItemGroup> + </Project> |
