mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-01 03:42:51 +01:00
Enable nullable for Jellyfin.Data and remove unnecessary attributes
This commit is contained in:
@@ -44,7 +44,6 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// <remarks>
|
||||
/// Required, Max length = 65535.
|
||||
/// </remarks>
|
||||
[Required]
|
||||
[MaxLength(65535)]
|
||||
[StringLength(65535)]
|
||||
public string Path { get; set; }
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#pragma warning disable CA2227
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Jellyfin.Data.Interfaces;
|
||||
|
||||
namespace Jellyfin.Data.Entities.Libraries
|
||||
@@ -32,7 +31,6 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
public virtual ICollection<Company> Publishers { get; protected set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
[NotMapped]
|
||||
public ICollection<Company> Companies => Publishers;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// </remarks>
|
||||
[MaxLength(1024)]
|
||||
[StringLength(1024)]
|
||||
public string Name { get; set; }
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the language.
|
||||
@@ -54,7 +54,6 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// Required, Min length = 3, Max length = 3
|
||||
/// ISO-639-3 3-character language codes.
|
||||
/// </remarks>
|
||||
[Required]
|
||||
[MinLength(3)]
|
||||
[MaxLength(3)]
|
||||
[StringLength(3)]
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// </remarks>
|
||||
[MaxLength(1024)]
|
||||
[StringLength(1024)]
|
||||
public string Name { get; set; }
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
[ConcurrencyCheck]
|
||||
|
||||
@@ -9,6 +9,15 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// </summary>
|
||||
public class CollectionItem : IHasConcurrencyToken
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CollectionItem"/> class.
|
||||
/// </summary>
|
||||
/// <param name="libraryItem">The library item.</param>
|
||||
public CollectionItem(LibraryItem libraryItem)
|
||||
{
|
||||
LibraryItem = libraryItem;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the id.
|
||||
/// </summary>
|
||||
@@ -36,7 +45,7 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// <remarks>
|
||||
/// TODO check if this properly updated Dependant and has the proper principal relationship.
|
||||
/// </remarks>
|
||||
public virtual CollectionItem Next { get; set; }
|
||||
public virtual CollectionItem? Next { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the previous item in the collection.
|
||||
@@ -44,7 +53,7 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// <remarks>
|
||||
/// TODO check if this properly updated Dependant and has the proper principal relationship.
|
||||
/// </remarks>
|
||||
public virtual CollectionItem Previous { get; set; }
|
||||
public virtual CollectionItem? Previous { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public void OnSavingChanges()
|
||||
|
||||
@@ -18,6 +18,7 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
public Company()
|
||||
{
|
||||
CompanyMetadata = new HashSet<CompanyMetadata>();
|
||||
ChildCompanies = new HashSet<Company>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -44,7 +45,6 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
public virtual ICollection<Company> ChildCompanies { get; protected set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
[NotMapped]
|
||||
public ICollection<Company> Companies => ChildCompanies;
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// </remarks>
|
||||
[MaxLength(65535)]
|
||||
[StringLength(65535)]
|
||||
public string Description { get; set; }
|
||||
public string? Description { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the headquarters.
|
||||
@@ -34,7 +34,7 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// </remarks>
|
||||
[MaxLength(255)]
|
||||
[StringLength(255)]
|
||||
public string Headquarters { get; set; }
|
||||
public string? Headquarters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the country code.
|
||||
@@ -44,7 +44,7 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// </remarks>
|
||||
[MaxLength(2)]
|
||||
[StringLength(2)]
|
||||
public string Country { get; set; }
|
||||
public string? Country { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the homepage.
|
||||
@@ -54,6 +54,6 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// </remarks>
|
||||
[MaxLength(1024)]
|
||||
[StringLength(1024)]
|
||||
public string Homepage { get; set; }
|
||||
public string? Homepage { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using System;
|
||||
|
||||
namespace Jellyfin.Data.Entities.Libraries
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// </remarks>
|
||||
[MaxLength(1024)]
|
||||
[StringLength(1024)]
|
||||
public string Outline { get; set; }
|
||||
public string? Outline { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the plot.
|
||||
@@ -34,7 +34,7 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// </remarks>
|
||||
[MaxLength(65535)]
|
||||
[StringLength(65535)]
|
||||
public string Plot { get; set; }
|
||||
public string? Plot { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the tagline.
|
||||
@@ -44,6 +44,6 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// </remarks>
|
||||
[MaxLength(1024)]
|
||||
[StringLength(1024)]
|
||||
public string Tagline { get; set; }
|
||||
public string? Tagline { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,6 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// <remarks>
|
||||
/// Indexed, Required, Max length = 255.
|
||||
/// </remarks>
|
||||
[Required]
|
||||
[MaxLength(255)]
|
||||
[StringLength(255)]
|
||||
public string Name { get; set; }
|
||||
|
||||
@@ -57,7 +57,6 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// <remarks>
|
||||
/// Required, Max length = 1024.
|
||||
/// </remarks>
|
||||
[Required]
|
||||
[MaxLength(1024)]
|
||||
[StringLength(1024)]
|
||||
public string Title { get; set; }
|
||||
@@ -70,7 +69,7 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// </remarks>
|
||||
[MaxLength(1024)]
|
||||
[StringLength(1024)]
|
||||
public string OriginalTitle { get; set; }
|
||||
public string? OriginalTitle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the sort title.
|
||||
@@ -80,7 +79,7 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// </remarks>
|
||||
[MaxLength(1024)]
|
||||
[StringLength(1024)]
|
||||
public string SortTitle { get; set; }
|
||||
public string? SortTitle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the language.
|
||||
@@ -89,7 +88,6 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// Required, Min length = 3, Max length = 3.
|
||||
/// ISO-639-3 3-character language codes.
|
||||
/// </remarks>
|
||||
[Required]
|
||||
[MinLength(3)]
|
||||
[MaxLength(3)]
|
||||
[StringLength(3)]
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Jellyfin.Data.Interfaces;
|
||||
@@ -14,14 +13,11 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// Initializes a new instance of the <see cref="Library"/> class.
|
||||
/// </summary>
|
||||
/// <param name="name">The name of the library.</param>
|
||||
public Library(string name)
|
||||
/// <param name="path">The path of the library.</param>
|
||||
public Library(string name, string path)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(name))
|
||||
{
|
||||
throw new ArgumentNullException(nameof(name));
|
||||
}
|
||||
|
||||
Name = name;
|
||||
Path = path;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -39,7 +35,6 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// <remarks>
|
||||
/// Required, Max length = 128.
|
||||
/// </remarks>
|
||||
[Required]
|
||||
[MaxLength(128)]
|
||||
[StringLength(128)]
|
||||
public string Name { get; set; }
|
||||
@@ -50,7 +45,6 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// <remarks>
|
||||
/// Required.
|
||||
/// </remarks>
|
||||
[Required]
|
||||
public string Path { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -44,7 +44,6 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// <remarks>
|
||||
/// Required.
|
||||
/// </remarks>
|
||||
[Required]
|
||||
public virtual Library Library { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -47,7 +47,6 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// <remarks>
|
||||
/// Required, Max length = 65535.
|
||||
/// </remarks>
|
||||
[Required]
|
||||
[MaxLength(65535)]
|
||||
[StringLength(65535)]
|
||||
public string Path { get; set; }
|
||||
|
||||
@@ -39,7 +39,6 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// <remarks>
|
||||
/// Required, Max length = 1024.
|
||||
/// </remarks>
|
||||
[Required]
|
||||
[MaxLength(1024)]
|
||||
[StringLength(1024)]
|
||||
public string Name { get; set; }
|
||||
|
||||
@@ -14,7 +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>
|
||||
public MetadataProviderId(string providerId)
|
||||
/// <param name="metadataProvider">The metadata provider.</param>
|
||||
public MetadataProviderId(string providerId, MetadataProvider metadataProvider)
|
||||
{
|
||||
if (string.IsNullOrEmpty(providerId))
|
||||
{
|
||||
@@ -22,6 +23,7 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
}
|
||||
|
||||
ProviderId = providerId;
|
||||
MetadataProvider = metadataProvider;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -39,7 +41,6 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// <remarks>
|
||||
/// Required, Max length = 255.
|
||||
/// </remarks>
|
||||
[Required]
|
||||
[MaxLength(255)]
|
||||
[StringLength(255)]
|
||||
public string ProviderId { get; set; }
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Jellyfin.Data.Interfaces;
|
||||
|
||||
namespace Jellyfin.Data.Entities.Libraries
|
||||
@@ -30,7 +29,7 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// </remarks>
|
||||
[MaxLength(1024)]
|
||||
[StringLength(1024)]
|
||||
public string Outline { get; set; }
|
||||
public string? Outline { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the tagline.
|
||||
@@ -40,7 +39,7 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// </remarks>
|
||||
[MaxLength(1024)]
|
||||
[StringLength(1024)]
|
||||
public string Tagline { get; set; }
|
||||
public string? Tagline { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the plot.
|
||||
@@ -50,7 +49,7 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// </remarks>
|
||||
[MaxLength(65535)]
|
||||
[StringLength(65535)]
|
||||
public string Plot { get; set; }
|
||||
public string? Plot { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the country code.
|
||||
@@ -60,7 +59,7 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// </remarks>
|
||||
[MaxLength(2)]
|
||||
[StringLength(2)]
|
||||
public string Country { get; set; }
|
||||
public string? Country { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the studios that produced this movie.
|
||||
@@ -68,7 +67,6 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
public virtual ICollection<Company> Studios { get; protected set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
[NotMapped]
|
||||
public ICollection<Company> Companies => Studios;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// </remarks>
|
||||
[MaxLength(255)]
|
||||
[StringLength(255)]
|
||||
public string Barcode { get; set; }
|
||||
public string? Barcode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the label number.
|
||||
@@ -38,7 +38,7 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// </remarks>
|
||||
[MaxLength(255)]
|
||||
[StringLength(255)]
|
||||
public string LabelNumber { get; set; }
|
||||
public string? LabelNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the country code.
|
||||
@@ -48,7 +48,7 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// </remarks>
|
||||
[MaxLength(2)]
|
||||
[StringLength(2)]
|
||||
public string Country { get; set; }
|
||||
public string? Country { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a collection containing the labels.
|
||||
|
||||
@@ -46,7 +46,6 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// <remarks>
|
||||
/// Required, Max length = 1024.
|
||||
/// </remarks>
|
||||
[Required]
|
||||
[MaxLength(1024)]
|
||||
[StringLength(1024)]
|
||||
public string Name { get; set; }
|
||||
@@ -59,7 +58,7 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// </remarks>
|
||||
[MaxLength(256)]
|
||||
[StringLength(256)]
|
||||
public string SourceId { get; set; }
|
||||
public string? SourceId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the date added.
|
||||
|
||||
@@ -17,9 +17,12 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// Initializes a new instance of the <see cref="PersonRole"/> class.
|
||||
/// </summary>
|
||||
/// <param name="type">The role type.</param>
|
||||
public PersonRole(PersonRoleType type)
|
||||
/// <param name="person">The person.</param>
|
||||
public PersonRole(PersonRoleType type, Person person)
|
||||
{
|
||||
Type = type;
|
||||
Person = person;
|
||||
Artwork = new HashSet<Artwork>();
|
||||
Sources = new HashSet<MetadataProviderId>();
|
||||
}
|
||||
|
||||
@@ -40,7 +43,7 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// </remarks>
|
||||
[MaxLength(1024)]
|
||||
[StringLength(1024)]
|
||||
public string Role { get; set; }
|
||||
public string? Role { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the person's role type.
|
||||
@@ -60,7 +63,6 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// <remarks>
|
||||
/// Required.
|
||||
/// </remarks>
|
||||
[Required]
|
||||
public virtual Person Person { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// Gets or sets the rating type.
|
||||
/// If this is <c>null</c> it's the internal user rating.
|
||||
/// </summary>
|
||||
public virtual RatingSource RatingType { get; set; }
|
||||
public virtual RatingSource? RatingType { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public void OnSavingChanges()
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// </remarks>
|
||||
[MaxLength(1024)]
|
||||
[StringLength(1024)]
|
||||
public string Name { get; set; }
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the minimum value.
|
||||
@@ -62,7 +62,7 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// <summary>
|
||||
/// Gets or sets the metadata source.
|
||||
/// </summary>
|
||||
public virtual MetadataProviderId Source { get; set; }
|
||||
public virtual MetadataProviderId? Source { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public void OnSavingChanges()
|
||||
|
||||
@@ -45,7 +45,6 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// <remarks>
|
||||
/// Required, Max length = 1024.
|
||||
/// </remarks>
|
||||
[Required]
|
||||
[MaxLength(1024)]
|
||||
[StringLength(1024)]
|
||||
public string Name { get; set; }
|
||||
|
||||
@@ -24,6 +24,6 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// </remarks>
|
||||
[MaxLength(1024)]
|
||||
[StringLength(1024)]
|
||||
public string Outline { get; set; }
|
||||
public string? Outline { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// </remarks>
|
||||
[MaxLength(1024)]
|
||||
[StringLength(1024)]
|
||||
public string Outline { get; set; }
|
||||
public string? Outline { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the plot.
|
||||
@@ -40,7 +40,7 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// </remarks>
|
||||
[MaxLength(65535)]
|
||||
[StringLength(65535)]
|
||||
public string Plot { get; set; }
|
||||
public string? Plot { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the tagline.
|
||||
@@ -50,7 +50,7 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// </remarks>
|
||||
[MaxLength(1024)]
|
||||
[StringLength(1024)]
|
||||
public string Tagline { get; set; }
|
||||
public string? Tagline { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the country code.
|
||||
@@ -60,7 +60,7 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// </remarks>
|
||||
[MaxLength(2)]
|
||||
[StringLength(2)]
|
||||
public string Country { get; set; }
|
||||
public string? Country { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a collection containing the networks.
|
||||
@@ -68,7 +68,6 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
public virtual ICollection<Company> Networks { get; protected set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
[NotMapped]
|
||||
public ICollection<Company> Companies => Networks;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user