add more dlna options

This commit is contained in:
Luke Pulverenti 2014-03-23 16:49:05 -04:00
parent 7438aa6dfa
commit f226d94012
5 changed files with 11 additions and 8 deletions

View File

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

View File

@ -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; }
} }

View File

@ -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)

View File

@ -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;

View File

@ -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;
} }
} }
} }