aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/Devices/DeviceService.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2014-12-14 00:38:07 -0500
committerLuke <luke.pulverenti@gmail.com>2014-12-14 00:38:07 -0500
commit524293ea79ab61228f8326561be70bcca4d0ea8f (patch)
treeccfe163c8edafc8dd14b0b63d48712a6d504de9d /MediaBrowser.Api/Devices/DeviceService.cs
parent00da34b90a2f2fcee4d6aa584e25fccebb375b6d (diff)
parent9df9723fa8554df0fd51d777d3f781b0136de926 (diff)
Merge pull request #954 from MediaBrowser/dev
3.0.5462.0
Diffstat (limited to 'MediaBrowser.Api/Devices/DeviceService.cs')
-rw-r--r--MediaBrowser.Api/Devices/DeviceService.cs18
1 files changed, 3 insertions, 15 deletions
diff --git a/MediaBrowser.Api/Devices/DeviceService.cs b/MediaBrowser.Api/Devices/DeviceService.cs
index 0d86d6a5c..ab0a4a4b2 100644
--- a/MediaBrowser.Api/Devices/DeviceService.cs
+++ b/MediaBrowser.Api/Devices/DeviceService.cs
@@ -1,22 +1,19 @@
using MediaBrowser.Controller.Devices;
using MediaBrowser.Controller.Net;
using MediaBrowser.Model.Devices;
+using MediaBrowser.Model.Querying;
using MediaBrowser.Model.Session;
using ServiceStack;
using ServiceStack.Web;
-using System.Collections.Generic;
using System.IO;
-using System.Linq;
using System.Threading.Tasks;
namespace MediaBrowser.Api.Devices
{
[Route("/Devices", "GET", Summary = "Gets all devices")]
[Authenticated(Roles = "Admin")]
- public class GetDevices : IReturn<List<DeviceInfo>>
+ public class GetDevices : DeviceQuery, IReturn<QueryResult<DeviceInfo>>
{
- [ApiMember(Name = "SupportsContentUploading", Description = "SupportsContentUploading", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
- public bool? SupportsContentUploading { get; set; }
}
[Route("/Devices", "DELETE", Summary = "Deletes a device")]
@@ -109,16 +106,7 @@ namespace MediaBrowser.Api.Devices
public object Get(GetDevices request)
{
- var devices = _deviceManager.GetDevices();
-
- if (request.SupportsContentUploading.HasValue)
- {
- var val = request.SupportsContentUploading.Value;
-
- devices = devices.Where(i => _deviceManager.GetCapabilities(i.Id).SupportsContentUploading == val);
- }
-
- return ToOptimizedResult(devices.ToList());
+ return ToOptimizedResult(_deviceManager.GetDevices(request));
}
public object Get(GetCameraUploads request)