// Kyoo - A portable and vast media library solution. // Copyright (c) Kyoo. // // See AUTHORS.md and LICENSE file in the project root for full license information. // // Kyoo is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // any later version. // // Kyoo is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Kyoo. If not, see . using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; namespace Kyoo.Abstractions.Models { /// /// The type of item, ether a show, a movie or a collection. /// public enum NewsKind { /// /// The is an . /// Episode, /// /// The is a Movie. /// Movie, } /// /// A new item /// public class News : IResource, IMetadata, IThumbnails, IAddedDate { /// public int Id { get; set; } /// [MaxLength(256)] public string Slug { get; set; } /// /// The title of this show. /// public string? Name { get; set; } /// /// A catchphrase for this movie. /// public string? Tagline { get; set; } /// /// The list of alternative titles of this show. /// public string[] Aliases { get; set; } = Array.Empty(); /// /// The path of the movie video file. /// public string Path { get; set; } /// /// The summary of this show. /// public string? Overview { get; set; } /// /// A list of tags that match this movie. /// public string[] Tags { get; set; } = Array.Empty(); /// /// The list of genres (themes) this show has. /// public Genre[] Genres { get; set; } = Array.Empty(); /// /// Is this show airing, not aired yet or finished? /// public Status? Status { get; set; } /// /// The date this movie aired. /// public DateTime? AirDate { get; set; } /// /// The date this movie aired. /// public DateTime? ReleaseDate => AirDate; /// public DateTime AddedDate { get; set; } /// public Image? Poster { get; set; } /// public Image? Thumbnail { get; set; } /// public Image? Logo { get; set; } /// /// A video of a few minutes that tease the content. /// public string? Trailer { get; set; } /// public Dictionary ExternalId { get; set; } = new(); /// /// The season in witch this episode is in. /// public int? SeasonNumber { get; set; } /// /// The number of this episode in it's season. /// public int? EpisodeNumber { get; set; } /// /// The absolute number of this episode. It's an episode number that is not reset to 1 after a new season. /// public int? AbsoluteNumber { get; set; } /// /// A simple summary of informations about the show of this episode /// (this is specially useful since news can't have includes). /// public ShowInfo? Show { get; set; } /// /// Is the item a a movie or an episode? /// public NewsKind Kind { get; set; } /// /// Links to watch this movie. /// public VideoLinks Links => new() { Direct = $"/video/{Kind.ToString().ToLower()}/{Slug}/direct", Hls = $"/video/{Kind.ToString().ToLower()}/{Slug}/master.m3u8", }; /// /// A simple summary of informations about the show of this episode /// (this is specially useful since news can't have includes). /// public class ShowInfo : IResource, IThumbnails { /// public int Id { get; set; } /// public string Slug { get; set; } /// /// The title of this show. /// public string Name { get; set; } /// public Image? Poster { get; set; } /// public Image? Thumbnail { get; set; } /// public Image? Logo { get; set; } } } }