using System.Text.Json; using System.Text.Json.Serialization; namespace FileFlows.VideoNodes; internal class VideoMetadata { public string Title { get; set; } public string Subtitle { get; set; } public string Description { get; set; } public int Year { get; set; } public DateTime ReleaseDate { get; set; } public string ArtJpeg { get; set; } public int? Season { get; set; } public int? Episode { get; set; } private List _Actors = new (); public List Actors { get => _Actors; set { _Actors = value ?? new(); } } private List _Directors = new(); public List Directors { get => _Directors; set { _Directors = value ?? new(); } } private List _Writers = new(); public List Writers { get => _Writers; set { _Writers = value ?? new(); } } private List _Producers = new(); public List Producers { get => _Producers; set { _Producers = value ?? new(); } } private List _Genres = new(); public List Genres { get => _Genres; set { _Genres = value ?? new(); } } public static VideoMetadata Convert(object source) { try { #pragma warning disable IL2026 string json = JsonSerializer.Serialize(source); var result = JsonSerializer.Deserialize(json); #pragma warning restore IL2026 return result ?? new (); } catch (Exception) { return new (); } } }