From be29b4a0c4e0a525da0a8537810d11586cec9b67 Mon Sep 17 00:00:00 2001 From: Niels van Velzen Date: Tue, 6 Feb 2024 22:16:41 +0100 Subject: [PATCH] Fix some incompatible API deprecations --- .../SessionDtos/ClientCapabilitiesDto.cs | 13 +++++++++ .../Session/ClientCapabilities.cs | 11 +++++++ MediaBrowser.Model/System/SystemInfo.cs | 29 +++++-------------- 3 files changed, 32 insertions(+), 21 deletions(-) diff --git a/Jellyfin.Api/Models/SessionDtos/ClientCapabilitiesDto.cs b/Jellyfin.Api/Models/SessionDtos/ClientCapabilitiesDto.cs index acd3f29e34..12ce19368b 100644 --- a/Jellyfin.Api/Models/SessionDtos/ClientCapabilitiesDto.cs +++ b/Jellyfin.Api/Models/SessionDtos/ClientCapabilitiesDto.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Text.Json.Serialization; using Jellyfin.Data.Enums; using Jellyfin.Extensions.Json.Converters; @@ -50,6 +51,18 @@ public class ClientCapabilitiesDto /// public string? IconUrl { get; set; } +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + // TODO: Remove after 10.9 + [Obsolete("Unused")] + [DefaultValue(false)] + public bool? SupportsContentUploading { get; set; } + + // TODO: Remove after 10.9 + [Obsolete("Unused")] + [DefaultValue(false)] + public bool? SupportsSync { get; set; } +#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member + /// /// Convert the dto to the full model. /// diff --git a/MediaBrowser.Model/Session/ClientCapabilities.cs b/MediaBrowser.Model/Session/ClientCapabilities.cs index 597845fc17..5f51fb21c3 100644 --- a/MediaBrowser.Model/Session/ClientCapabilities.cs +++ b/MediaBrowser.Model/Session/ClientCapabilities.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using Jellyfin.Data.Enums; using MediaBrowser.Model.Dlna; @@ -30,5 +31,15 @@ namespace MediaBrowser.Model.Session public string AppStoreUrl { get; set; } public string IconUrl { get; set; } + + // TODO: Remove after 10.9 + [Obsolete("Unused")] + [DefaultValue(false)] + public bool? SupportsContentUploading { get; set; } + + // TODO: Remove after 10.9 + [Obsolete("Unused")] + [DefaultValue(false)] + public bool? SupportsSync { get; set; } } } diff --git a/MediaBrowser.Model/System/SystemInfo.cs b/MediaBrowser.Model/System/SystemInfo.cs index aa7c03ebd5..f37ac6a147 100644 --- a/MediaBrowser.Model/System/SystemInfo.cs +++ b/MediaBrowser.Model/System/SystemInfo.cs @@ -3,29 +3,11 @@ using System; using System.Collections.Generic; -using System.Runtime.InteropServices; +using System.ComponentModel; using MediaBrowser.Model.Updates; namespace MediaBrowser.Model.System { - /// - /// Enum describing the location of the FFmpeg tool. - /// - public enum FFmpegLocation - { - /// No path to FFmpeg found. - NotFound, - - /// Path supplied via command line using switch --ffmpeg. - SetByArgument, - - /// User has supplied path via Transcoding UI page. - Custom, - - /// FFmpeg tool found on system $PATH. - System - } - /// /// Class SystemInfo. /// @@ -83,9 +65,11 @@ namespace MediaBrowser.Model.System /// /// true. [Obsolete("This is always true")] + [DefaultValue(true)] public bool CanSelfRestart { get; set; } = true; [Obsolete("This is always false")] + [DefaultValue(false)] public bool CanLaunchWebBrowser { get; set; } = false; /// @@ -140,12 +124,15 @@ namespace MediaBrowser.Model.System /// /// true if this instance has update available; otherwise, false. [Obsolete("This should be handled by the package manager")] + [DefaultValue(false)] public bool HasUpdateAvailable { get; set; } [Obsolete("This isn't set correctly anymore")] - public FFmpegLocation EncoderLocation { get; set; } + [DefaultValue("System")] + public string EncoderLocation { get; set; } = "System"; [Obsolete("This is no longer set")] - public Architecture SystemArchitecture { get; set; } = Architecture.X64; + [DefaultValue("X64")] + public string SystemArchitecture { get; set; } = "X64"; } }