mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-04-24 05:57:20 -04:00
sync updates
This commit is contained in:
parent
e6e5d1a794
commit
cf0875ef6c
10 changed files with 11 additions and 73 deletions
|
@ -345,7 +345,6 @@
|
|||
<Compile Include="Sync\ISyncManager.cs" />
|
||||
<Compile Include="Sync\ISyncProvider.cs" />
|
||||
<Compile Include="Sync\ISyncRepository.cs" />
|
||||
<Compile Include="Sync\SyncAccount.cs" />
|
||||
<Compile Include="Themes\IAppThemeManager.cs" />
|
||||
<Compile Include="Themes\InternalThemeImage.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
|
||||
{
|
||||
|
@ -13,7 +14,8 @@ namespace MediaBrowser.Controller.Sync
|
|||
/// <summary>
|
||||
/// Gets the synchronize targets.
|
||||
/// </summary>
|
||||
/// <param name="userId">The user identifier.</param>
|
||||
/// <returns>IEnumerable<SyncTarget>.</returns>
|
||||
IEnumerable<SyncAccount> GetSyncAccounts();
|
||||
IEnumerable<SyncTarget> GetSyncTargets(string userId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,12 +12,6 @@ namespace MediaBrowser.Controller.Sync
|
|||
/// <value>The name.</value>
|
||||
string Name { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the synchronize targets.
|
||||
/// </summary>
|
||||
/// <returns>IEnumerable<SyncTarget>.</returns>
|
||||
IEnumerable<SyncTarget> GetSyncTargets();
|
||||
|
||||
/// <summary>
|
||||
/// Gets the synchronize targets.
|
||||
/// </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;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
return _deviceManager.GetDevices(new DeviceQuery
|
||||
|
|
|
@ -19,16 +19,9 @@ namespace MediaBrowser.Server.Implementations.Sync
|
|||
_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)
|
||||
{
|
||||
return _providers
|
||||
.SelectMany(i => i.GetSyncAccounts().Where(a => a.UserIds.Contains(userId, StringComparer.OrdinalIgnoreCase)).Select(a => GetSyncTarget(i, a)));
|
||||
return _providers.SelectMany(i => i.GetSyncTargets(userId));
|
||||
}
|
||||
|
||||
public DeviceProfile GetDeviceProfile(SyncTarget target)
|
||||
|
@ -36,15 +29,6 @@ namespace MediaBrowser.Server.Implementations.Sync
|
|||
return new DeviceProfile();
|
||||
}
|
||||
|
||||
private SyncTarget GetSyncTarget(ICloudSyncProvider provider, SyncAccount account)
|
||||
{
|
||||
return new SyncTarget
|
||||
{
|
||||
Name = account.Name,
|
||||
Id = account.Name
|
||||
};
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return "Cloud Sync"; }
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>MediaBrowser.Common.Internal</id>
|
||||
<version>3.0.560</version>
|
||||
<version>3.0.561</version>
|
||||
<title>MediaBrowser.Common.Internal</title>
|
||||
<authors>Luke</authors>
|
||||
<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>
|
||||
<copyright>Copyright © Media Browser 2013</copyright>
|
||||
<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="SimpleInjector" version="2.6.1" />
|
||||
</dependencies>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>MediaBrowser.Common</id>
|
||||
<version>3.0.560</version>
|
||||
<version>3.0.561</version>
|
||||
<title>MediaBrowser.Common</title>
|
||||
<authors>Media Browser Team</authors>
|
||||
<owners>ebr,Luke,scottisafool</owners>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>MediaBrowser.Model.Signed</id>
|
||||
<version>3.0.560</version>
|
||||
<version>3.0.561</version>
|
||||
<title>MediaBrowser.Model - Signed Edition</title>
|
||||
<authors>Media Browser Team</authors>
|
||||
<owners>ebr,Luke,scottisafool</owners>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>MediaBrowser.Server.Core</id>
|
||||
<version>3.0.560</version>
|
||||
<version>3.0.561</version>
|
||||
<title>Media Browser.Server.Core</title>
|
||||
<authors>Media Browser Team</authors>
|
||||
<owners>ebr,Luke,scottisafool</owners>
|
||||
|
@ -12,7 +12,7 @@
|
|||
<description>Contains core components required to build plugins for Media Browser Server.</description>
|
||||
<copyright>Copyright © Media Browser 2013</copyright>
|
||||
<dependencies>
|
||||
<dependency id="MediaBrowser.Common" version="3.0.560" />
|
||||
<dependency id="MediaBrowser.Common" version="3.0.561" />
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue