From 87aee1625da956669bce724177821378f4f3158c Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 23 Mar 2014 15:36:25 -0400 Subject: add new device profiles --- MediaBrowser.Api/SessionsService.cs | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) (limited to 'MediaBrowser.Api/SessionsService.cs') diff --git a/MediaBrowser.Api/SessionsService.cs b/MediaBrowser.Api/SessionsService.cs index e73e3490ec..070fe9e598 100644 --- a/MediaBrowser.Api/SessionsService.cs +++ b/MediaBrowser.Api/SessionsService.cs @@ -14,8 +14,7 @@ namespace MediaBrowser.Api /// /// Class GetSessions /// - [Route("/Sessions", "GET")] - [Api(("Gets a list of sessions"))] + [Route("/Sessions", "GET", Summary = "Gets a list of sessions")] public class GetSessions : IReturn> { /// @@ -35,8 +34,7 @@ namespace MediaBrowser.Api /// /// Class BrowseTo /// - [Route("/Sessions/{Id}/Viewing", "POST")] - [Api(("Instructs a session to browse to an item or view"))] + [Route("/Sessions/{Id}/Viewing", "POST", Summary = "Instructs a session to browse to an item or view")] public class BrowseTo : IReturnVoid { /// @@ -77,8 +75,7 @@ namespace MediaBrowser.Api public string Context { get; set; } } - [Route("/Sessions/{Id}/Playing", "POST")] - [Api(("Instructs a session to play an item"))] + [Route("/Sessions/{Id}/Playing", "POST", Summary = "Instructs a session to play an item")] public class Play : IReturnVoid { /// @@ -110,8 +107,7 @@ namespace MediaBrowser.Api public PlayCommand PlayCommand { get; set; } } - [Route("/Sessions/{Id}/Playing/{Command}", "POST")] - [Api(("Issues a playstate command to a client"))] + [Route("/Sessions/{Id}/Playing/{Command}", "POST", Summary = "Issues a playstate command to a client")] public class SendPlaystateCommand : IReturnVoid { /// @@ -135,8 +131,7 @@ namespace MediaBrowser.Api public PlaystateCommand Command { get; set; } } - [Route("/Sessions/{Id}/System/{Command}", "POST")] - [Api(("Issues a system command to a client"))] + [Route("/Sessions/{Id}/System/{Command}", "POST", Summary = "Issues a system command to a client")] public class SendSystemCommand : IReturnVoid { /// @@ -154,8 +149,7 @@ namespace MediaBrowser.Api public SystemCommand Command { get; set; } } - [Route("/Sessions/{Id}/Message", "POST")] - [Api(("Issues a command to a client to display a message to the user"))] + [Route("/Sessions/{Id}/Message", "POST", Summary = "Issues a command to a client to display a message to the user")] public class SendMessageCommand : IReturnVoid { /// @@ -175,8 +169,7 @@ namespace MediaBrowser.Api public long? TimeoutMs { get; set; } } - [Route("/Sessions/{Id}/Users/{UserId}", "POST")] - [Api(("Adds an additional user to a session"))] + [Route("/Sessions/{Id}/Users/{UserId}", "POST", Summary = "Adds an additional user to a session")] public class AddUserToSession : IReturnVoid { [ApiMember(Name = "Id", Description = "Session Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "POST")] @@ -186,8 +179,7 @@ namespace MediaBrowser.Api public Guid UserId { get; set; } } - [Route("/Sessions/{Id}/Users/{UserId}", "DELETE")] - [Api(("Removes an additional user from a session"))] + [Route("/Sessions/{Id}/Users/{UserId}", "DELETE", Summary = "Removes an additional user from a session")] public class RemoveUserFromSession : IReturnVoid { [ApiMember(Name = "Id", Description = "Session Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "POST")] @@ -197,8 +189,7 @@ namespace MediaBrowser.Api public Guid UserId { get; set; } } - [Route("/Sessions/{Id}/Capabilities", "POST")] - [Api(("Updates capabilities for a device"))] + [Route("/Sessions/{Id}/Capabilities", "POST", Summary = "Updates capabilities for a device")] public class PostCapabilities : IReturnVoid { /// -- cgit v1.2.3 From f226d94012cbe0ce0855efadc561ec4fb215fc94 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 23 Mar 2014 16:49:05 -0400 Subject: add more dlna options --- MediaBrowser.Api/Playback/StreamRequest.cs | 3 +-- MediaBrowser.Api/SessionsService.cs | 2 +- MediaBrowser.Dlna/PlayTo/PlayToManager.cs | 4 +++- MediaBrowser.Dlna/PlayTo/SsdpHttpClient.cs | 6 +++--- MediaBrowser.Model/Configuration/DlnaOptions.cs | 4 +++- 5 files changed, 11 insertions(+), 8 deletions(-) (limited to 'MediaBrowser.Api/SessionsService.cs') diff --git a/MediaBrowser.Api/Playback/StreamRequest.cs b/MediaBrowser.Api/Playback/StreamRequest.cs index 67948e19ab..3439621e95 100644 --- a/MediaBrowser.Api/Playback/StreamRequest.cs +++ b/MediaBrowser.Api/Playback/StreamRequest.cs @@ -1,5 +1,4 @@ -using MediaBrowser.Model.Dto; -using ServiceStack; +using ServiceStack; namespace MediaBrowser.Api.Playback { diff --git a/MediaBrowser.Api/SessionsService.cs b/MediaBrowser.Api/SessionsService.cs index 070fe9e598..a509c876ce 100644 --- a/MediaBrowser.Api/SessionsService.cs +++ b/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; } } diff --git a/MediaBrowser.Dlna/PlayTo/PlayToManager.cs b/MediaBrowser.Dlna/PlayTo/PlayToManager.cs index d7460c352e..f3901e0b40 100644 --- a/MediaBrowser.Dlna/PlayTo/PlayToManager.cs +++ b/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) diff --git a/MediaBrowser.Dlna/PlayTo/SsdpHttpClient.cs b/MediaBrowser.Dlna/PlayTo/SsdpHttpClient.cs index 7a4928e5ca..f540a80041 100644 --- a/MediaBrowser.Dlna/PlayTo/SsdpHttpClient.cs +++ b/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; diff --git a/MediaBrowser.Model/Configuration/DlnaOptions.cs b/MediaBrowser.Model/Configuration/DlnaOptions.cs index b2503ebc7e..893e377faf 100644 --- a/MediaBrowser.Model/Configuration/DlnaOptions.cs +++ b/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; } } } -- cgit v1.2.3