Skip to content

Commit

Permalink
Fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
Shadowghost committed Nov 12, 2024
1 parent ee42be6 commit c32f7ed
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/Jellyfin.Plugin.Dlna.Model/ContentFeatureBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public static string BuildAudioHeader(
}

/// <summary>
/// Gets the auvideodio header.
/// Gets the video header.
/// </summary>
/// <param name="profile">The <see cref="DlnaDeviceProfile"/>.</param>
/// <param name="container">The container.</param>
Expand Down
14 changes: 7 additions & 7 deletions src/Rssdp/SsdpDeviceLocator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ public class SsdpDeviceLocator : DisposableManagedObjectBase
private Timer? _broadcastTimer;
private readonly object _timerLock = new();

private readonly string _oSName;
private readonly string _osName;

private readonly string _oSVersion;
private readonly string _osVersion;

private readonly TimeSpan _defaultSearchWaitTime = TimeSpan.FromSeconds(4);
private readonly TimeSpan _oneSecond = TimeSpan.FromSeconds(1);
Expand All @@ -42,8 +42,8 @@ public SsdpDeviceLocator(
ArgumentNullException.ThrowIfNullOrEmpty(osName);
ArgumentNullException.ThrowIfNullOrEmpty(osVersion);

_oSName = osName;
_oSVersion = osVersion;
_osName = osName;
_osVersion = osVersion;
_communicationsServer = communicationsServer;
_communicationsServer.ResponseReceived += CommsServer_ResponseReceived;

Expand Down Expand Up @@ -347,7 +347,7 @@ private Task BroadcastDiscoverMessage(string serviceType, TimeSpan mxValue, Canc
var values = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
{
["HOST"] = string.Format(CultureInfo.InvariantCulture, "{0}:{1}", SsdpConstants.MulticastLocalAdminAddress, SsdpConstants.MulticastPort),
["USER-AGENT"] = string.Format(CultureInfo.InvariantCulture, "{0}/{1} UPnP/1.0 RSSDP/{2}", _oSName, _oSVersion, SsdpConstants.ServerVersion),
["USER-AGENT"] = string.Format(CultureInfo.InvariantCulture, "{0}/{1} UPnP/1.0 RSSDP/{2}", _osName, _osVersion, SsdpConstants.ServerVersion),
["MAN"] = "\"ssdp:discover\"",

// Search target
Expand Down Expand Up @@ -377,9 +377,9 @@ private void ProcessSearchResponseMessage(HttpResponseMessage message, IPAddress
DescriptionLocation = location,
Usn = GetFirstHeaderStringValue("USN", message),
NotificationType = GetFirstHeaderStringValue("ST", message),
CacheLifetime = CacheAgeFromHeader(message?.Headers?.CacheControl),
CacheLifetime = CacheAgeFromHeader(message.Headers.CacheControl),
AsAt = DateTimeOffset.Now,
ResponseHeaders = message?.Headers
ResponseHeaders = message.Headers
};

AddOrUpdateDiscoveredDevice(device, IPAddress);
Expand Down
14 changes: 7 additions & 7 deletions src/Rssdp/SsdpDevicePublisher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ namespace Rssdp.Infrastructure
public class SsdpDevicePublisher : DisposableManagedObjectBase, ISsdpDevicePublisher
{
private ISsdpCommunicationsServer _commsServer;
private readonly string _oSName;
private readonly string _oSVersion;
private readonly string _osName;
private readonly string _osVersion;
private readonly bool _sendOnlyMatchedHost;
private readonly List<SsdpRootDevice> _devices;

Expand Down Expand Up @@ -58,8 +58,8 @@ public SsdpDevicePublisher(

_commsServer = communicationsServer;
_commsServer.RequestReceived += CommsServer_RequestReceived;
_oSName = osName;
_oSVersion = osVersion;
_osName = osName;
_osVersion = osVersion;
_sendOnlyMatchedHost = sendOnlyMatchedHost;

_commsServer.BeginListeningForMulticast();
Expand Down Expand Up @@ -324,7 +324,7 @@ private async void SendSearchResponse(
["HOST"] = string.Format(CultureInfo.InvariantCulture, "{0}:{1}", SsdpConstants.MulticastLocalAdminAddress, SsdpConstants.MulticastPort),
["CACHE-CONTROL"] = "max-age = " + rootDevice.CacheLifetime.TotalSeconds,
["ST"] = searchTarget,
["SERVER"] = string.Format(CultureInfo.InvariantCulture, "{0}/{1} UPnP/1.0 RSSDP/{2}", _oSName, _oSVersion, SsdpConstants.ServerVersion),
["SERVER"] = string.Format(CultureInfo.InvariantCulture, "{0}/{1} UPnP/1.0 RSSDP/{2}", _osName, _osVersion, SsdpConstants.ServerVersion),
["USN"] = uniqueServiceName,
["LOCATION"] = rootDevice?.Location?.ToString() ?? string.Empty
};
Expand Down Expand Up @@ -458,7 +458,7 @@ private void SendAliveNotification(SsdpDevice device, string notificationType, s
["DATE"] = DateTime.UtcNow.ToString("r"),
["CACHE-CONTROL"] = "max-age = " + rootDevice.CacheLifetime.TotalSeconds,
["LOCATION"] = rootDevice?.Location?.ToString() ?? string.Empty,
["SERVER"] = string.Format(CultureInfo.InvariantCulture, "{0}/{1} UPnP/1.0 RSSDP/{2}", _oSName, _oSVersion, SsdpConstants.ServerVersion),
["SERVER"] = string.Format(CultureInfo.InvariantCulture, "{0}/{1} UPnP/1.0 RSSDP/{2}", _osName, _osVersion, SsdpConstants.ServerVersion),
["NTS"] = "ssdp:alive",
["NT"] = notificationType,
["USN"] = uniqueServiceName
Expand Down Expand Up @@ -503,7 +503,7 @@ private Task SendByeByeNotification(SsdpDevice device, string notificationType,
// If needed later for non-server devices, these headers will need to be dynamic
["HOST"] = string.Format(CultureInfo.InvariantCulture, "{0}:{1}", SsdpConstants.MulticastLocalAdminAddress, SsdpConstants.MulticastPort),
["DATE"] = DateTime.UtcNow.ToString("r"),
["SERVER"] = string.Format(CultureInfo.InvariantCulture, "{0}/{1} UPnP/1.0 RSSDP/{2}", _oSName, _oSVersion, SsdpConstants.ServerVersion),
["SERVER"] = string.Format(CultureInfo.InvariantCulture, "{0}/{1} UPnP/1.0 RSSDP/{2}", _osName, _osVersion, SsdpConstants.ServerVersion),
["NTS"] = "ssdp:byebye",
["NT"] = notificationType,
["USN"] = uniqueServiceName
Expand Down

0 comments on commit c32f7ed

Please sign in to comment.