diff options
| author | ferferga <ferferga.fer@gmail.com> | 2020-10-19 17:28:07 +0200 |
|---|---|---|
| committer | ferferga <ferferga.fer@gmail.com> | 2020-10-19 17:28:07 +0200 |
| commit | 9fd01fade6ac971ba72a2e7dd54e2295f23839bc (patch) | |
| tree | 20a5ff4a1621e765fc93c0e53b149edb61ff3654 /Jellyfin.Data/Entities/Libraries/BookMetadata.cs | |
| parent | ba03ed65fe64b724b3e8b5b94b9cbe1075c61da2 (diff) | |
| parent | 49ac4c4044b1777dc3a25544aead7b0b15b953e8 (diff) | |
Remove "download images in advance" option
Diffstat (limited to 'Jellyfin.Data/Entities/Libraries/BookMetadata.cs')
| -rw-r--r-- | Jellyfin.Data/Entities/Libraries/BookMetadata.cs | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/Jellyfin.Data/Entities/Libraries/BookMetadata.cs b/Jellyfin.Data/Entities/Libraries/BookMetadata.cs new file mode 100644 index 000000000..4a3d290f0 --- /dev/null +++ b/Jellyfin.Data/Entities/Libraries/BookMetadata.cs @@ -0,0 +1,57 @@ +#pragma warning disable CA2227 + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations.Schema; +using Jellyfin.Data.Interfaces; + +namespace Jellyfin.Data.Entities.Libraries +{ + /// <summary> + /// An entity containing metadata for a book. + /// </summary> + public class BookMetadata : ItemMetadata, IHasCompanies + { + /// <summary> + /// Initializes a new instance of the <see cref="BookMetadata"/> class. + /// </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="book">The book.</param> + public BookMetadata(string title, string language, Book book) : base(title, language) + { + if (book == null) + { + throw new ArgumentNullException(nameof(book)); + } + + book.BookMetadata.Add(this); + + Publishers = new HashSet<Company>(); + } + + /// <summary> + /// Initializes a new instance of the <see cref="BookMetadata"/> class. + /// </summary> + /// <remarks> + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// </remarks> + protected BookMetadata() + { + } + + /// <summary> + /// Gets or sets the ISBN. + /// </summary> + public long? Isbn { get; set; } + + /// <summary> + /// Gets or sets a collection of the publishers for this book. + /// </summary> + public virtual ICollection<Company> Publishers { get; protected set; } + + /// <inheritdoc /> + [NotMapped] + public ICollection<Company> Companies => Publishers; + } +} |
