sync updates

pull/702/head
Luke Pulverenti 10 years ago
parent e6e5d1a794
commit cf0875ef6c

@ -345,7 +345,6 @@
<Compile Include="Sync\ISyncManager.cs" /> <Compile Include="Sync\ISyncManager.cs" />
<Compile Include="Sync\ISyncProvider.cs" /> <Compile Include="Sync\ISyncProvider.cs" />
<Compile Include="Sync\ISyncRepository.cs" /> <Compile Include="Sync\ISyncRepository.cs" />
<Compile Include="Sync\SyncAccount.cs" />
<Compile Include="Themes\IAppThemeManager.cs" /> <Compile Include="Themes\IAppThemeManager.cs" />
<Compile Include="Themes\InternalThemeImage.cs" /> <Compile Include="Themes\InternalThemeImage.cs" />
<Compile Include="TV\ITVSeriesManager.cs" /> <Compile Include="TV\ITVSeriesManager.cs" />

@ -1,4 +1,5 @@
using System.Collections.Generic; using MediaBrowser.Model.Sync;
using System.Collections.Generic;
namespace MediaBrowser.Controller.Sync namespace MediaBrowser.Controller.Sync
{ {
@ -13,7 +14,8 @@ namespace MediaBrowser.Controller.Sync
/// <summary> /// <summary>
/// Gets the synchronize targets. /// Gets the synchronize targets.
/// </summary> /// </summary>
/// <param name="userId">The user identifier.</param>
/// <returns>IEnumerable&lt;SyncTarget&gt;.</returns> /// <returns>IEnumerable&lt;SyncTarget&gt;.</returns>
IEnumerable<SyncAccount> GetSyncAccounts(); IEnumerable<SyncTarget> GetSyncTargets(string userId);
} }
} }

@ -12,12 +12,6 @@ namespace MediaBrowser.Controller.Sync
/// <value>The name.</value> /// <value>The name.</value>
string Name { get; } string Name { get; }
/// <summary>
/// Gets the synchronize targets.
/// </summary>
/// <returns>IEnumerable&lt;SyncTarget&gt;.</returns>
IEnumerable<SyncTarget> GetSyncTargets();
/// <summary> /// <summary>
/// Gets the synchronize targets. /// Gets the synchronize targets.
/// </summary> /// </summary>

@ -1,28 +0,0 @@
using System.Collections.Generic;
namespace MediaBrowser.Controller.Sync
{
public class SyncAccount
{
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
public string Name { get; set; }
/// <summary>
/// Gets or sets the identifier.
/// </summary>
/// <value>The identifier.</value>
public string Id { get; set; }
/// <summary>
/// Gets or sets the user identifier.
/// </summary>
/// <value>The user identifier.</value>
public List<string> UserIds { get; set; }
public SyncAccount()
{
UserIds = new List<string>();
}
}
}

@ -17,19 +17,6 @@ namespace MediaBrowser.Server.Implementations.Sync
_deviceManager = deviceManager; _deviceManager = deviceManager;
} }
public IEnumerable<SyncTarget> GetSyncTargets()
{
return _deviceManager.GetDevices(new DeviceQuery
{
SupportsSync = true
}).Items.Select(i => new SyncTarget
{
Id = i.Id,
Name = i.Name
});
}
public IEnumerable<SyncTarget> GetSyncTargets(string userId) public IEnumerable<SyncTarget> GetSyncTargets(string userId)
{ {
return _deviceManager.GetDevices(new DeviceQuery return _deviceManager.GetDevices(new DeviceQuery

@ -19,16 +19,9 @@ namespace MediaBrowser.Server.Implementations.Sync
_providers = appHost.GetExports<ICloudSyncProvider>().ToArray(); _providers = appHost.GetExports<ICloudSyncProvider>().ToArray();
} }
public IEnumerable<SyncTarget> GetSyncTargets()
{
return _providers
.SelectMany(i => i.GetSyncAccounts().Select(a => GetSyncTarget(i, a)));
}
public IEnumerable<SyncTarget> GetSyncTargets(string userId) public IEnumerable<SyncTarget> GetSyncTargets(string userId)
{ {
return _providers return _providers.SelectMany(i => i.GetSyncTargets(userId));
.SelectMany(i => i.GetSyncAccounts().Where(a => a.UserIds.Contains(userId, StringComparer.OrdinalIgnoreCase)).Select(a => GetSyncTarget(i, a)));
} }
public DeviceProfile GetDeviceProfile(SyncTarget target) public DeviceProfile GetDeviceProfile(SyncTarget target)
@ -36,15 +29,6 @@ namespace MediaBrowser.Server.Implementations.Sync
return new DeviceProfile(); return new DeviceProfile();
} }
private SyncTarget GetSyncTarget(ICloudSyncProvider provider, SyncAccount account)
{
return new SyncTarget
{
Name = account.Name,
Id = account.Name
};
}
public string Name public string Name
{ {
get { return "Cloud Sync"; } get { return "Cloud Sync"; }

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Common.Internal</id> <id>MediaBrowser.Common.Internal</id>
<version>3.0.560</version> <version>3.0.561</version>
<title>MediaBrowser.Common.Internal</title> <title>MediaBrowser.Common.Internal</title>
<authors>Luke</authors> <authors>Luke</authors>
<owners>ebr,Luke,scottisafool</owners> <owners>ebr,Luke,scottisafool</owners>
@ -12,7 +12,7 @@
<description>Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.</description> <description>Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.</description>
<copyright>Copyright © Media Browser 2013</copyright> <copyright>Copyright © Media Browser 2013</copyright>
<dependencies> <dependencies>
<dependency id="MediaBrowser.Common" version="3.0.560" /> <dependency id="MediaBrowser.Common" version="3.0.561" />
<dependency id="NLog" version="3.1.0.0" /> <dependency id="NLog" version="3.1.0.0" />
<dependency id="SimpleInjector" version="2.6.1" /> <dependency id="SimpleInjector" version="2.6.1" />
</dependencies> </dependencies>

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Common</id> <id>MediaBrowser.Common</id>
<version>3.0.560</version> <version>3.0.561</version>
<title>MediaBrowser.Common</title> <title>MediaBrowser.Common</title>
<authors>Media Browser Team</authors> <authors>Media Browser Team</authors>
<owners>ebr,Luke,scottisafool</owners> <owners>ebr,Luke,scottisafool</owners>

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Model.Signed</id> <id>MediaBrowser.Model.Signed</id>
<version>3.0.560</version> <version>3.0.561</version>
<title>MediaBrowser.Model - Signed Edition</title> <title>MediaBrowser.Model - Signed Edition</title>
<authors>Media Browser Team</authors> <authors>Media Browser Team</authors>
<owners>ebr,Luke,scottisafool</owners> <owners>ebr,Luke,scottisafool</owners>

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Server.Core</id> <id>MediaBrowser.Server.Core</id>
<version>3.0.560</version> <version>3.0.561</version>
<title>Media Browser.Server.Core</title> <title>Media Browser.Server.Core</title>
<authors>Media Browser Team</authors> <authors>Media Browser Team</authors>
<owners>ebr,Luke,scottisafool</owners> <owners>ebr,Luke,scottisafool</owners>
@ -12,7 +12,7 @@
<description>Contains core components required to build plugins for Media Browser Server.</description> <description>Contains core components required to build plugins for Media Browser Server.</description>
<copyright>Copyright © Media Browser 2013</copyright> <copyright>Copyright © Media Browser 2013</copyright>
<dependencies> <dependencies>
<dependency id="MediaBrowser.Common" version="3.0.560" /> <dependency id="MediaBrowser.Common" version="3.0.561" />
</dependencies> </dependencies>
</metadata> </metadata>
<files> <files>

Loading…
Cancel
Save