using System; using Newtonsoft.Json; namespace Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist { /// /// A class representing TubeArchivist API video player data. /// public class Player { /// /// Initializes a new instance of the class. /// /// Duration of the video. /// Whether the video is marked as watched. /// Unix time of when the video has been marked watched. public Player(long duration, bool isWatched, long watchedUnixTime) { Duration = duration; IsWatched = isWatched; WatchedUnixTime = watchedUnixTime; } /// /// Gets the duration of the video. /// [JsonProperty(PropertyName = "duration")] public long Duration { get; } /// /// Gets a value indicating whether the video is marked as watched. /// [JsonProperty(PropertyName = "watched")] public bool IsWatched { get; } /// /// Gets the Unix date and time when the video has been marked as watched. /// [JsonProperty(PropertyName = "watched_date")] public long WatchedUnixTime { get; } /// /// Gets the date and time when the video has been marked as watched. /// [JsonIgnore] public DateTime WatchedTime { get => DateTimeOffset.FromUnixTimeSeconds(WatchedUnixTime).DateTime; } } }