浏览代码

add more dlna options

Luke Pulverenti 11 年之前
父节点
当前提交
f226d94012

+ 1 - 2
MediaBrowser.Api/Playback/StreamRequest.cs

@@ -1,5 +1,4 @@
-using MediaBrowser.Model.Dto;
-using ServiceStack;
+using ServiceStack;
 
 namespace MediaBrowser.Api.Playback
 {

+ 1 - 1
MediaBrowser.Api/SessionsService.cs

@@ -27,7 +27,7 @@ namespace MediaBrowser.Api
         [ApiMember(Name = "ControllableByUserId", Description = "Optional. Filter by sessions that a given user is allowed to remote control.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
         public Guid? ControllableByUserId { get; set; }
 
-        [ApiMember(Name = "DeviceId", Description = "Optional. Filter by device id.", IsRequired = false, DataType = "boolean", ParameterType = "query", Verb = "GET")]
+        [ApiMember(Name = "DeviceId", Description = "Optional. Filter by device id.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
         public string DeviceId { get; set; }
     }
 

+ 3 - 1
MediaBrowser.Dlna/PlayTo/PlayToManager.cs

@@ -176,7 +176,9 @@ namespace MediaBrowser.Dlna.PlayTo
                     {
                         socket.SendTo(request, new IPEndPoint(IPAddress.Parse("239.255.255.250"), 1900));
 
-                        await Task.Delay(10000).ConfigureAwait(false);
+                        var delay = _config.Configuration.DlnaOptions.ClientDiscoveryIntervalSeconds*1000;
+
+                        await Task.Delay(delay).ConfigureAwait(false);
                     }
                 }
                 catch (OperationCanceledException)

+ 3 - 3
MediaBrowser.Dlna/PlayTo/SsdpHttpClient.cs

@@ -49,7 +49,7 @@ namespace MediaBrowser.Dlna.PlayTo
             {
                 Url = url.ToString(),
                 UserAgent = USERAGENT,
-                LogRequest = _config.Configuration.DlnaOptions.EnablePlayToDebugLogging
+                LogRequest = _config.Configuration.DlnaOptions.EnableDebugLogging
             };
 
             options.RequestHeaders["HOST"] = ip + ":" + port;
@@ -88,7 +88,7 @@ namespace MediaBrowser.Dlna.PlayTo
             {
                 Url = url.ToString(),
                 UserAgent = USERAGENT,
-                LogRequest = _config.Configuration.DlnaOptions.EnablePlayToDebugLogging
+                LogRequest = _config.Configuration.DlnaOptions.EnableDebugLogging
             };
 
             options.RequestHeaders["FriendlyName.DLNA.ORG"] = FriendlyName;
@@ -112,7 +112,7 @@ namespace MediaBrowser.Dlna.PlayTo
             {
                 Url = url.ToString(),
                 UserAgent = USERAGENT,
-                LogRequest = _config.Configuration.DlnaOptions.EnablePlayToDebugLogging
+                LogRequest = _config.Configuration.DlnaOptions.EnableDebugLogging
             };
 
             options.RequestHeaders["SOAPAction"] = soapAction;

+ 3 - 1
MediaBrowser.Model/Configuration/DlnaOptions.cs

@@ -4,11 +4,13 @@ namespace MediaBrowser.Model.Configuration
     public class DlnaOptions
     {
         public bool EnablePlayTo { get; set; }
-        public bool EnablePlayToDebugLogging { get; set; }
+        public bool EnableDebugLogging { get; set; }
+        public int ClientDiscoveryIntervalSeconds { get; set; }
 
         public DlnaOptions()
         {
             EnablePlayTo = true;
+            ClientDiscoveryIntervalSeconds = 30;
         }
     }
 }