From 9d0c6a65bbec8dd8f7daea25d1db1f5a8229c477 Mon Sep 17 00:00:00 2001 From: Mikal Stordal Date: Sun, 8 Dec 2024 21:56:00 +0100 Subject: [PATCH] fix: fix serialization of component version --- Shokofin/API/Models/ComponentVersion.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Shokofin/API/Models/ComponentVersion.cs b/Shokofin/API/Models/ComponentVersion.cs index 7f3db89..ef612e0 100644 --- a/Shokofin/API/Models/ComponentVersion.cs +++ b/Shokofin/API/Models/ComponentVersion.cs @@ -2,6 +2,7 @@ using System.ComponentModel; using System.Linq; using System.Text.Json.Serialization; +using System.Xml.Serialization; using Shokofin.Extensions; namespace Shokofin.API.Models; @@ -18,8 +19,15 @@ public class ComponentVersion { /// Version number. /// [DefaultValue("1.0.0.0")] + [XmlIgnore] public Version Version { get; set; } = new("1.0.0.0"); + [XmlElement("Version")] + public string VersionString { + get => Version.ToString(); + set => Version = string.IsNullOrEmpty(value) ? new("1.0.0.0") : new(value); + } + /// /// Commit SHA. ///