Merge branch 'master' into fix-resharper-warnings

# Conflicts:
#	Emby.Server.Implementations/Net/SocketFactory.cs
#	RSSDP/SsdpCommunicationsServer.cs
#	RSSDP/SsdpDeviceLocator.cs
#	RSSDP/SsdpDevicePublisher.cs
This commit is contained in:
Stepan Goremykin
2023-10-12 20:11:16 +02:00
83 changed files with 1484 additions and 2131 deletions

View File

@@ -24,4 +24,21 @@ public static class ImageFormatExtensions
ImageFormat.Webp => "image/webp",
_ => throw new InvalidEnumArgumentException(nameof(format), (int)format, typeof(ImageFormat))
};
/// <summary>
/// Returns the correct extension for this <see cref="ImageFormat" />.
/// </summary>
/// <param name="format">This <see cref="ImageFormat" />.</param>
/// <exception cref="InvalidEnumArgumentException">The <paramref name="format"/> is an invalid enumeration value.</exception>
/// <returns>The correct extension for this <see cref="ImageFormat" />.</returns>
public static string GetExtension(this ImageFormat format)
=> format switch
{
ImageFormat.Bmp => ".bmp",
ImageFormat.Gif => ".gif",
ImageFormat.Jpg => ".jpg",
ImageFormat.Png => ".png",
ImageFormat.Webp => ".webp",
_ => throw new InvalidEnumArgumentException(nameof(format), (int)format, typeof(ImageFormat))
};
}

View File

@@ -47,6 +47,11 @@ public class IPData
/// </summary>
public int Index { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the network supports multicast.
/// </summary>
public bool SupportsMulticast { get; set; } = false;
/// <summary>
/// Gets or sets the interface name.
/// </summary>

View File

@@ -0,0 +1,42 @@
namespace MediaBrowser.Model.Net;
/// <summary>
/// Class holding information for a published server URI override.
/// </summary>
public class PublishedServerUriOverride
{
/// <summary>
/// Initializes a new instance of the <see cref="PublishedServerUriOverride"/> class.
/// </summary>
/// <param name="data">The <see cref="IPData"/>.</param>
/// <param name="overrideUri">The override.</param>
/// <param name="internalOverride">A value indicating whether the override is for internal requests.</param>
/// <param name="externalOverride">A value indicating whether the override is for external requests.</param>
public PublishedServerUriOverride(IPData data, string overrideUri, bool internalOverride, bool externalOverride)
{
Data = data;
OverrideUri = overrideUri;
IsInternalOverride = internalOverride;
IsExternalOverride = externalOverride;
}
/// <summary>
/// Gets or sets the object's IP address.
/// </summary>
public IPData Data { get; set; }
/// <summary>
/// Gets or sets the override URI.
/// </summary>
public string OverrideUri { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the override should be applied to internal requests.
/// </summary>
public bool IsInternalOverride { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the override should be applied to external requests.
/// </summary>
public bool IsExternalOverride { get; set; }
}

View File

@@ -84,7 +84,8 @@ namespace MediaBrowser.Model.System
[Obsolete("This is always true")]
public bool CanSelfRestart { get; set; } = true;
public bool CanLaunchWebBrowser { get; set; }
[Obsolete("This is always false")]
public bool CanLaunchWebBrowser { get; set; } = false;
/// <summary>
/// Gets or sets the program data path.