2019-06-01 16:40:01 -04:00
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
2020-08-30 18:50:54 -04:00
|
|
|
using Jellyfin.Data.Interfaces;
|
2019-06-01 16:40:01 -04:00
|
|
|
|
2020-08-29 13:30:09 -04:00
|
|
|
namespace Jellyfin.Data.Entities.Libraries
|
2019-06-01 16:40:01 -04:00
|
|
|
{
|
2020-08-30 18:50:54 -04:00
|
|
|
/// <summary>
|
|
|
|
/// An entity holding the metadata for a movie.
|
|
|
|
/// </summary>
|
|
|
|
public class MovieMetadata : Metadata, IHasCompanies
|
2020-05-02 17:56:05 -04:00
|
|
|
{
|
|
|
|
/// <summary>
|
2020-08-30 18:50:54 -04:00
|
|
|
/// Initializes a new instance of the <see cref="MovieMetadata"/> class.
|
2020-05-02 17:56:05 -04:00
|
|
|
/// </summary>
|
2020-08-30 18:50:54 -04:00
|
|
|
/// <param name="title">The title or name of the movie.</param>
|
2020-06-19 06:21:49 -04:00
|
|
|
/// <param name="language">ISO-639-3 3-character language codes.</param>
|
2020-08-30 18:50:54 -04:00
|
|
|
/// <param name="movie">The movie.</param>
|
|
|
|
public MovieMetadata(string title, string language, Movie movie) : base(title, language)
|
2020-05-02 17:56:05 -04:00
|
|
|
{
|
2020-08-30 18:50:54 -04:00
|
|
|
Studios = new HashSet<Company>();
|
2020-05-02 17:56:05 -04:00
|
|
|
|
2020-08-30 18:50:54 -04:00
|
|
|
movie.MovieMetadata.Add(this);
|
2020-05-02 17:56:05 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
2020-08-30 18:50:54 -04:00
|
|
|
/// Initializes a new instance of the <see cref="MovieMetadata"/> class.
|
2020-05-02 17:56:05 -04:00
|
|
|
/// </summary>
|
2020-08-30 18:50:54 -04:00
|
|
|
/// <remarks>
|
|
|
|
/// Default constructor. Protected due to required properties, but present because EF needs it.
|
|
|
|
/// </remarks>
|
|
|
|
protected MovieMetadata()
|
2020-05-02 17:56:05 -04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
2020-08-30 18:50:54 -04:00
|
|
|
/// Gets or sets the outline.
|
2020-05-02 17:56:05 -04:00
|
|
|
/// </summary>
|
2020-08-30 18:50:54 -04:00
|
|
|
/// <remarks>
|
|
|
|
/// Max length = 1024.
|
|
|
|
/// </remarks>
|
2020-05-02 17:56:05 -04:00
|
|
|
[MaxLength(1024)]
|
|
|
|
[StringLength(1024)]
|
2020-08-30 18:50:54 -04:00
|
|
|
public string Outline { get; set; }
|
2020-05-02 17:56:05 -04:00
|
|
|
|
|
|
|
/// <summary>
|
2020-08-30 18:50:54 -04:00
|
|
|
/// Gets or sets the tagline.
|
2020-05-02 17:56:05 -04:00
|
|
|
/// </summary>
|
2020-08-30 18:50:54 -04:00
|
|
|
/// <remarks>
|
|
|
|
/// Max length = 1024.
|
|
|
|
/// </remarks>
|
2020-05-02 17:56:05 -04:00
|
|
|
[MaxLength(1024)]
|
|
|
|
[StringLength(1024)]
|
2020-08-30 18:50:54 -04:00
|
|
|
public string Tagline { get; set; }
|
2020-05-02 17:56:05 -04:00
|
|
|
|
|
|
|
/// <summary>
|
2020-08-30 18:50:54 -04:00
|
|
|
/// Gets or sets the plot.
|
2020-05-02 17:56:05 -04:00
|
|
|
/// </summary>
|
2020-08-30 18:50:54 -04:00
|
|
|
/// <remarks>
|
|
|
|
/// Max length = 65535.
|
|
|
|
/// </remarks>
|
|
|
|
[MaxLength(65535)]
|
|
|
|
[StringLength(65535)]
|
|
|
|
public string Plot { get; set; }
|
2020-05-02 17:56:05 -04:00
|
|
|
|
|
|
|
/// <summary>
|
2020-08-30 18:50:54 -04:00
|
|
|
/// Gets or sets the country code.
|
2020-05-02 17:56:05 -04:00
|
|
|
/// </summary>
|
2020-08-30 18:50:54 -04:00
|
|
|
/// <remarks>
|
|
|
|
/// Max length = 2.
|
|
|
|
/// </remarks>
|
2020-05-02 17:56:05 -04:00
|
|
|
[MaxLength(2)]
|
|
|
|
[StringLength(2)]
|
2020-08-30 18:50:54 -04:00
|
|
|
public string Country { get; set; }
|
2019-06-01 16:40:01 -04:00
|
|
|
|
2020-08-30 18:50:54 -04:00
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets the studios that produced this movie.
|
|
|
|
/// </summary>
|
2020-05-02 17:56:05 -04:00
|
|
|
public virtual ICollection<Company> Studios { get; protected set; }
|
2020-08-30 18:50:54 -04:00
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
[NotMapped]
|
|
|
|
public ICollection<Company> Companies => Studios;
|
2020-05-02 17:56:05 -04:00
|
|
|
}
|
2019-06-01 16:40:01 -04:00
|
|
|
}
|