add more dlna options

pull/702/head
Luke Pulverenti 11 years ago
parent 7438aa6dfa
commit f226d94012

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

@ -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")] [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; } 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; } public string DeviceId { get; set; }
} }

@ -176,7 +176,9 @@ namespace MediaBrowser.Dlna.PlayTo
{ {
socket.SendTo(request, new IPEndPoint(IPAddress.Parse("239.255.255.250"), 1900)); 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) catch (OperationCanceledException)

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

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

Loading…
Cancel
Save