aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/Devices/DeviceService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Api/Devices/DeviceService.cs')
-rw-r--r--MediaBrowser.Api/Devices/DeviceService.cs28
1 files changed, 3 insertions, 25 deletions
diff --git a/MediaBrowser.Api/Devices/DeviceService.cs b/MediaBrowser.Api/Devices/DeviceService.cs
index 135397308..ab0a4a4b2 100644
--- a/MediaBrowser.Api/Devices/DeviceService.cs
+++ b/MediaBrowser.Api/Devices/DeviceService.cs
@@ -1,25 +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; }
-
- [ApiMember(Name = "SupportsDeviceId", Description = "SupportsDeviceId", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
- public bool? SupportsDeviceId { get; set; }
}
[Route("/Devices", "DELETE", Summary = "Deletes a device")]
@@ -112,23 +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);
- }
-
- if (request.SupportsDeviceId.HasValue)
- {
- var val = request.SupportsDeviceId.Value;
-
- devices = devices.Where(i => _deviceManager.GetCapabilities(i.Id).SupportsDeviceId == val);
- }
-
- return ToOptimizedResult(devices.ToList());
+ return ToOptimizedResult(_deviceManager.GetDevices(request));
}
public object Get(GetCameraUploads request)