The Free Software Media System - Server Backend & API
display sync targets
Luke Pulverenti7f7d2f85e324
diff --git a/MediaBrowser.Model/Devices/DeviceQuery.cs b/MediaBrowser.Model/Devices/DeviceQuery.csindex 76f7117b64..c3b4313f46 100644--- a/MediaBrowser.Model/Devices/DeviceQuery.cs+++ b/MediaBrowser.Model/Devices/DeviceQuery.cs@@ -13,5 +13,10 @@ namespace MediaBrowser.Model.Devices/// </summary>/// <value><c>null</c> if [supports unique identifier] contains no value, <c>true</c> if [supports unique identifier]; otherwise, <c>false</c>.</value>public bool? SupportsUniqueIdentifier { get; set; }+ /// <summary>+ /// Gets or sets a value indicating whether [supports synchronize].+ /// </summary>+ /// <value><c>null</c> if [supports synchronize] contains no value, <c>true</c> if [supports synchronize]; otherwise, <c>false</c>.</value>+ public bool? SupportsSync { get; set; }}}diff --git a/MediaBrowser.Server.Implementations/Devices/DeviceManager.cs b/MediaBrowser.Server.Implementations/Devices/DeviceManager.csindex 8c67013ea3..6cdc581185 100644--- a/MediaBrowser.Server.Implementations/Devices/DeviceManager.cs+++ b/MediaBrowser.Server.Implementations/Devices/DeviceManager.cs@@ -91,6 +91,13 @@ namespace MediaBrowser.Server.Implementations.Devicesdevices = devices.Where(i => GetCapabilities(i.Id).SupportsContentUploading == val);}+ if (query.SupportsSync.HasValue)+ {+ var val = query.SupportsSync.Value;++ devices = devices.Where(i => GetCapabilities(i.Id).SupportsSync == val);+ }+if (query.SupportsUniqueIdentifier.HasValue){var val = query.SupportsUniqueIdentifier.Value;diff --git a/MediaBrowser.Server.Implementations/Sync/AppSyncProvider.cs b/MediaBrowser.Server.Implementations/Sync/AppSyncProvider.csindex c3cd047b6b..94eed50f60 100644--- a/MediaBrowser.Server.Implementations/Sync/AppSyncProvider.cs+++ b/MediaBrowser.Server.Implementations/Sync/AppSyncProvider.cs@@ -1,16 +1,33 @@-using MediaBrowser.Controller.Sync;+using MediaBrowser.Controller.Devices;+using MediaBrowser.Controller.Sync;+using MediaBrowser.Model.Devices;using MediaBrowser.Model.Dlna;using MediaBrowser.Model.Sync;-using System;using System.Collections.Generic;+using System.Linq;namespace MediaBrowser.Server.Implementations.Sync{public class AppSyncProvider : ISyncProvider{+ private readonly IDeviceManager _deviceManager;++ public AppSyncProvider(IDeviceManager deviceManager)+ {+ _deviceManager = deviceManager;+ }+public IEnumerable<SyncTarget> GetSyncTargets(){- return new List<SyncTarget>();+ return _deviceManager.GetDevices(new DeviceQuery+ {+ SupportsSync = true++ }).Items.Select(i => new SyncTarget+ {+ Id = i.Id,+ Name = i.Name+ });}public DeviceProfile GetDeviceProfile(SyncTarget target)