diff --git a/lib/media-organizer.XmlSerializers/media-organizer.XmlSerializers.csproj b/lib/media-organizer.XmlSerializers/media-organizer.XmlSerializers.csproj new file mode 100644 index 0000000..f9273c1 --- /dev/null +++ b/lib/media-organizer.XmlSerializers/media-organizer.XmlSerializers.csproj @@ -0,0 +1,39 @@ + + + + + + net8.0 + true + media-organizer + media-organizer.XmlSerializers + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/media-organizer/Tools/Types/LsDvd/Audio.cs b/lib/media-organizer/Tools/Types/LsDvd/Audio.cs new file mode 100755 index 0000000..ee45f53 --- /dev/null +++ b/lib/media-organizer/Tools/Types/LsDvd/Audio.cs @@ -0,0 +1,59 @@ +using System.ComponentModel; +using System.Diagnostics.CodeAnalysis; +using System.Text.Json.Serialization; +using System.Xml.Serialization; + +namespace MediaOrganizer.Tools.Types.LsDvd; + +public sealed class Audio +{ + [XmlElement("ix", typeof(int))] + public int? Index { get; [param: NotNull] set; } + [Browsable(false), JsonIgnore] + public bool IndexSpecified => Index.HasValue; + + [XmlElement("langcode")] + public string? LangCode { get; [param: NotNull] set; } + [Browsable(false), JsonIgnore] + public bool LangCodeSpecified => !string.IsNullOrWhiteSpace(LangCode); + + [XmlElement("language")] + public string? Language { get; [param: NotNull] set; } + [Browsable(false), JsonIgnore] + public bool LanguageSpecified => !string.IsNullOrWhiteSpace(Language); + + [XmlElement("format")] + public string? Format { get; [param: NotNull] set; } + [Browsable(false), JsonIgnore] + public bool FormatSpecified => !string.IsNullOrWhiteSpace(Format); + + [XmlElement("frequency", typeof(int))] + public int? Frequency { get; [param: NotNull] set; } + [Browsable(false), JsonIgnore] + public bool FrequencySpecified => Frequency.HasValue; + + [XmlElement("quantization")] + public string? Quantization { get; [param: NotNull] set; } + [Browsable(false), JsonIgnore] + public bool QuantizationSpecified => !string.IsNullOrWhiteSpace(Quantization); + + [XmlElement("channels", typeof(int))] + public int? Channels { get; [param: NotNull] set; } + [Browsable(false), JsonIgnore] + public bool ChannelsSpecified => Channels.HasValue; + + [XmlElement("ap_mode", typeof(int))] + public int? ApMode { get; [param: NotNull] set; } + [Browsable(false), JsonIgnore] + public bool ApModeSpecified => ApMode.HasValue; + + [XmlElement("content")] + public string? Content { get; [param: NotNull] set; } + [Browsable(false), JsonIgnore] + public bool ContentSpecified => !string.IsNullOrWhiteSpace(Content); + + [XmlElement("streamid")] + public string? StreamId { get; [param: NotNull] set; } + [Browsable(false), JsonIgnore] + public bool StreamIdSpecified => !string.IsNullOrWhiteSpace(StreamId); +} diff --git a/lib/media-organizer/Tools/Types/LsDvd/Cell.cs b/lib/media-organizer/Tools/Types/LsDvd/Cell.cs new file mode 100755 index 0000000..3feda65 --- /dev/null +++ b/lib/media-organizer/Tools/Types/LsDvd/Cell.cs @@ -0,0 +1,19 @@ +using System.ComponentModel; +using System.Diagnostics.CodeAnalysis; +using System.Text.Json.Serialization; +using System.Xml.Serialization; + +namespace MediaOrganizer.Tools.Types.LsDvd; + +public sealed class Cell +{ + [XmlElement("ix", typeof(int))] + public int? Index { get; [param: NotNull] set; } + [Browsable(false), JsonIgnore] + public bool IndexSpecified => Index.HasValue; + + [XmlElement("length", typeof(double))] + public double? Length { get; [param: NotNull] set; } + [Browsable(false), JsonIgnore] + public bool LengthSpecified => Length.HasValue; +} diff --git a/lib/media-organizer/Tools/Types/LsDvd/Chapter.cs b/lib/media-organizer/Tools/Types/LsDvd/Chapter.cs new file mode 100755 index 0000000..7ac08b4 --- /dev/null +++ b/lib/media-organizer/Tools/Types/LsDvd/Chapter.cs @@ -0,0 +1,24 @@ +using System.ComponentModel; +using System.Diagnostics.CodeAnalysis; +using System.Text.Json.Serialization; +using System.Xml.Serialization; + +namespace MediaOrganizer.Tools.Types.LsDvd; + +public sealed class Chapter +{ + [XmlElement("ix", typeof(int))] + public int? Index { get; [param: NotNull] set; } + [Browsable(false), JsonIgnore] + public bool IndexSpecified => Index.HasValue; + + [XmlElement("length", typeof(double))] + public double? Length { get; [param: NotNull] set; } + [Browsable(false), JsonIgnore] + public bool LengthSpecified => Length.HasValue; + + [XmlElement("startcell", typeof(int))] + public int? StartCell { get; [param: NotNull] set; } + [Browsable(false), JsonIgnore] + public bool StartCellSpecified => StartCell.HasValue; +} diff --git a/lib/media-organizer/Tools/Types/LsDvd/LsDvdResult.cs b/lib/media-organizer/Tools/Types/LsDvd/LsDvdResult.cs new file mode 100755 index 0000000..ae6c0ca --- /dev/null +++ b/lib/media-organizer/Tools/Types/LsDvd/LsDvdResult.cs @@ -0,0 +1,38 @@ +using System.ComponentModel; +using System.Diagnostics.CodeAnalysis; +using System.Text.Json.Serialization; +using System.Xml.Serialization; + +namespace MediaOrganizer.Tools.Types.LsDvd; + +[XmlRoot("lsdvd")] +public sealed class LsDvdResult +{ + [XmlElement("device")] + public string? Device { get; [param: NotNull] set; } + [Browsable(false), JsonIgnore] + public bool DeviceSpecified => !string.IsNullOrWhiteSpace(Device); + + [XmlElement("title")] + public string? Title { get; [param: NotNull] set; } + [Browsable(false), JsonIgnore] + public bool TitleSpecified => !string.IsNullOrWhiteSpace(Title); + + [XmlElement("vmg_id")] + public string? VmgId { get; [param: NotNull] set; } + [Browsable(false), JsonIgnore] + public bool VmgIdSpecified => !string.IsNullOrWhiteSpace(VmgId); + + [XmlElement("provider_id")] + public string? ProviderId { get; [param: NotNull] set; } + [Browsable(false), JsonIgnore] + public bool ProviderIdSpecified => !string.IsNullOrWhiteSpace(ProviderId); + + [XmlElement("track")] + public List Tracks { get; } = []; + + [XmlElement("longest_track")] + public int? LongestTrack { get; [param: NotNull] set; } + [Browsable(false), JsonIgnore] + public bool LongestTrackSpecified => LongestTrack.HasValue; +} diff --git a/lib/media-organizer/Tools/Types/LsDvd/Subtitle.cs b/lib/media-organizer/Tools/Types/LsDvd/Subtitle.cs new file mode 100755 index 0000000..90edaf9 --- /dev/null +++ b/lib/media-organizer/Tools/Types/LsDvd/Subtitle.cs @@ -0,0 +1,34 @@ +using System.ComponentModel; +using System.Diagnostics.CodeAnalysis; +using System.Text.Json.Serialization; +using System.Xml.Serialization; + +namespace MediaOrganizer.Tools.Types.LsDvd; + +public sealed class Subtitle +{ + [XmlElement("ix", typeof(int))] + public int? Index { get; [param: NotNull] set; } + [Browsable(false), JsonIgnore] + public bool IndexSpecified => Index.HasValue; + + [XmlElement("langcode")] + public string? LangCode { get; [param: NotNull] set; } + [Browsable(false), JsonIgnore] + public bool LangCodeSpecified => !string.IsNullOrWhiteSpace(LangCode); + + [XmlElement("language")] + public string? Language { get; [param: NotNull] set; } + [Browsable(false), JsonIgnore] + public bool LanguageSpecified => !string.IsNullOrWhiteSpace(Language); + + [XmlElement("content")] + public string? Content { get; [param: NotNull] set; } + [Browsable(false), JsonIgnore] + public bool ContentSpecified => !string.IsNullOrWhiteSpace(Content); + + [XmlElement("streamid")] + public string? StreamId { get; [param: NotNull] set; } + [Browsable(false), JsonIgnore] + public bool StreamIdSpecified => !string.IsNullOrWhiteSpace(StreamId); +} diff --git a/lib/media-organizer/Tools/Types/LsDvd/Track.cs b/lib/media-organizer/Tools/Types/LsDvd/Track.cs new file mode 100755 index 0000000..eb79f43 --- /dev/null +++ b/lib/media-organizer/Tools/Types/LsDvd/Track.cs @@ -0,0 +1,84 @@ +using System.ComponentModel; +using System.Diagnostics.CodeAnalysis; +using System.Text.Json.Serialization; +using System.Xml.Serialization; + +namespace MediaOrganizer.Tools.Types.LsDvd; + +public sealed class Track +{ + [XmlElement("ix", typeof(int))] + public int? Index { get; [param: NotNull] set; } + [Browsable(false), JsonIgnore] + public bool IndexSpecified => Index.HasValue; + + [XmlElement("length", typeof(double))] + public double? Length { get; [param: NotNull] set; } + [Browsable(false), JsonIgnore] + public bool LengthSpecified => Length.HasValue; + + [XmlElement("vts_id")] + public string? VtsId { get; [param: NotNull] set; } + [Browsable(false), JsonIgnore] + public bool VtsIdSpecified => !string.IsNullOrWhiteSpace(VtsId); + + [XmlElement("vts", typeof(int))] + public int? Vts { get; [param: NotNull] set; } + [Browsable(false), JsonIgnore] + public bool VtsSpecified => Vts.HasValue; + + [XmlElement("ttn", typeof(int))] + public int? Ttn { get; [param: NotNull] set; } + [Browsable(false), JsonIgnore] + public bool TtnSpecified => Vts.HasValue; + + [XmlElement("fps", typeof(double))] + public double? FPS { get; [param: NotNull] set; } + [Browsable(false), JsonIgnore] + public bool FPSSpecified => FPS.HasValue; + + [XmlElement("format")] + public string? Format { get; [param: NotNull] set; } + [Browsable(false), JsonIgnore] + public bool FormatSpecified => !string.IsNullOrWhiteSpace(Format); + + [XmlElement("aspect")] + public string? Aspect { get; [param: NotNull] set; } + [Browsable(false), JsonIgnore] + public bool AspectSpecified => !string.IsNullOrWhiteSpace(Aspect); + + [XmlElement("width", typeof(int))] + public int? Width { get; [param: NotNull] set; } + [Browsable(false), JsonIgnore] + public bool WidthSpecified => Width.HasValue; + + [XmlElement("height", typeof(int))] + public int? Height { get; [param: NotNull] set; } + [Browsable(false), JsonIgnore] + public bool HeightSpecified => Height.HasValue; + + [XmlElement("df")] + public string? Df { get; [param: NotNull] set; } + [Browsable(false), JsonIgnore] + public bool DfSpecified => !string.IsNullOrWhiteSpace(Df); + + [XmlArray("palette"), XmlArrayItem("color", IsNullable = false)] + public List Palette { get; } = []; + + [XmlElement("angles", typeof(int))] + public int? Angles { get; [param: NotNull] set; } + [Browsable(false), JsonIgnore] + public bool AnglesSpecified => Angles.HasValue; + + [XmlElement("audio")] + public List