diff options
Diffstat (limited to 'Jellyfin.Data/Entities/BookMetadata.cs')
| -rw-r--r-- | Jellyfin.Data/Entities/BookMetadata.cs | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/Jellyfin.Data/Entities/BookMetadata.cs b/Jellyfin.Data/Entities/BookMetadata.cs index d52fe7605..df43090d3 100644 --- a/Jellyfin.Data/Entities/BookMetadata.cs +++ b/Jellyfin.Data/Entities/BookMetadata.cs @@ -27,20 +27,32 @@ namespace Jellyfin.Data.Entities } /// <summary> - /// Public constructor with required data + /// Public constructor with required data. /// </summary> - /// <param name="title">The title or name of the object</param> - /// <param name="language">ISO-639-3 3-character language codes</param> + /// <param name="title">The title or name of the object.</param> + /// <param name="language">ISO-639-3 3-character language codes.</param> /// <param name="_book0"></param> public BookMetadata(string title, string language, DateTime dateadded, DateTime datemodified, Book _book0) { - if (string.IsNullOrEmpty(title)) throw new ArgumentNullException(nameof(title)); + if (string.IsNullOrEmpty(title)) + { + throw new ArgumentNullException(nameof(title)); + } + this.Title = title; - if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language)); + if (string.IsNullOrEmpty(language)) + { + throw new ArgumentNullException(nameof(language)); + } + this.Language = language; - if (_book0 == null) throw new ArgumentNullException(nameof(_book0)); + if (_book0 == null) + { + throw new ArgumentNullException(nameof(_book0)); + } + _book0.BookMetadata.Add(this); this.Publishers = new HashSet<Company>(); @@ -51,8 +63,8 @@ namespace Jellyfin.Data.Entities /// <summary> /// Static create function (for use in LINQ queries, etc.) /// </summary> - /// <param name="title">The title or name of the object</param> - /// <param name="language">ISO-639-3 3-character language codes</param> + /// <param name="title">The title or name of the object.</param> + /// <param name="language">ISO-639-3 3-character language codes.</param> /// <param name="_book0"></param> public static BookMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, Book _book0) { @@ -64,7 +76,7 @@ namespace Jellyfin.Data.Entities *************************************************************************/ /// <summary> - /// Backing field for ISBN + /// Backing field for ISBN. /// </summary> protected long? _ISBN; /// <summary> @@ -82,8 +94,9 @@ namespace Jellyfin.Data.Entities { long? value = _ISBN; GetISBN(ref value); - return (_ISBN = value); + return _ISBN = value; } + set { long? oldValue = _ISBN; @@ -101,7 +114,6 @@ namespace Jellyfin.Data.Entities [ForeignKey("Company_Publishers_Id")] public virtual ICollection<Company> Publishers { get; protected set; } - } } |
