From 2bf2d5fd769788cade10a84fc7a4a4af23c23cf1 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 28 Feb 2015 08:42:47 -0500 Subject: cloud sync updates --- MediaBrowser.Controller/Drawing/IImageProcessor.cs | 6 +-- .../MediaBrowser.Controller.csproj | 2 +- MediaBrowser.Controller/Sync/ICloudSyncProvider.cs | 46 ------------------ .../Sync/IServerSyncProvider.cs | 54 ++++++++++++++++++++-- MediaBrowser.Controller/Sync/ISyncDataProvider.cs | 41 ++++++++++++++++ MediaBrowser.Controller/Sync/ISyncProvider.cs | 7 --- 6 files changed, 94 insertions(+), 62 deletions(-) delete mode 100644 MediaBrowser.Controller/Sync/ICloudSyncProvider.cs create mode 100644 MediaBrowser.Controller/Sync/ISyncDataProvider.cs (limited to 'MediaBrowser.Controller') diff --git a/MediaBrowser.Controller/Drawing/IImageProcessor.cs b/MediaBrowser.Controller/Drawing/IImageProcessor.cs index 8ac7d56d29..6fafc2b464 100644 --- a/MediaBrowser.Controller/Drawing/IImageProcessor.cs +++ b/MediaBrowser.Controller/Drawing/IImageProcessor.cs @@ -2,7 +2,6 @@ using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Drawing; using MediaBrowser.Model.Entities; -using System; using System.Collections.Generic; using System.IO; using System.Threading.Tasks; @@ -30,10 +29,9 @@ namespace MediaBrowser.Controller.Drawing /// /// Gets the size of the image. /// - /// The path. - /// The image date modified. + /// The information. /// ImageSize. - ImageSize GetImageSize(string path, DateTime imageDateModified); + ImageSize GetImageSize(ItemImageInfo info); /// /// Adds the parts. diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj index e9531e0571..603cb02e0d 100644 --- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj +++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj @@ -341,8 +341,8 @@ - + diff --git a/MediaBrowser.Controller/Sync/ICloudSyncProvider.cs b/MediaBrowser.Controller/Sync/ICloudSyncProvider.cs deleted file mode 100644 index 8f03aea0a0..0000000000 --- a/MediaBrowser.Controller/Sync/ICloudSyncProvider.cs +++ /dev/null @@ -1,46 +0,0 @@ -using MediaBrowser.Model.Sync; -using System; -using System.Collections.Generic; -using System.IO; -using System.Threading; -using System.Threading.Tasks; - -namespace MediaBrowser.Controller.Sync -{ - public interface ICloudSyncProvider - { - /// - /// Gets the name. - /// - /// The name. - string Name { get; } - - /// - /// Gets the synchronize targets. - /// - /// The user identifier. - /// IEnumerable<SyncTarget>. - IEnumerable GetSyncTargets(string userId); - - /// - /// Transfers the item file. - /// - /// The input file. - /// The path parts. - /// The target. - /// The progress. - /// The cancellation token. - /// Task. - Task SendFile(string inputFile, string[] pathParts, SyncTarget target, IProgress progress, CancellationToken cancellationToken); - - /// - /// Gets the file. - /// - /// The path parts. - /// The target. - /// The progress. - /// The cancellation token. - /// Task<Stream>. - Task GetFile(string[] pathParts, SyncTarget target, IProgress progress, CancellationToken cancellationToken); - } -} diff --git a/MediaBrowser.Controller/Sync/IServerSyncProvider.cs b/MediaBrowser.Controller/Sync/IServerSyncProvider.cs index b3e74ee7db..9ee83acbf7 100644 --- a/MediaBrowser.Controller/Sync/IServerSyncProvider.cs +++ b/MediaBrowser.Controller/Sync/IServerSyncProvider.cs @@ -1,5 +1,6 @@ using MediaBrowser.Model.Sync; using System; +using System.Collections.Generic; using System.IO; using System.Threading; using System.Threading.Tasks; @@ -12,21 +13,66 @@ namespace MediaBrowser.Controller.Sync /// Transfers the file. /// /// The input file. - /// The path parts. + /// The path. /// The target. /// The progress. /// The cancellation token. /// Task. - Task SendFile(string inputFile, string[] pathParts, SyncTarget target, IProgress progress, CancellationToken cancellationToken); + Task SendFile(string inputFile, string path, SyncTarget target, IProgress progress, CancellationToken cancellationToken); + + /// + /// Deletes the file. + /// + /// The path. + /// The target. + /// The cancellation token. + /// Task. + Task DeleteFile(string path, SyncTarget target, CancellationToken cancellationToken); /// /// Gets the file. /// - /// The path parts. + /// The path. /// The target. /// The progress. /// The cancellation token. /// Task<Stream>. - Task GetFile(string[] pathParts, SyncTarget target, IProgress progress, CancellationToken cancellationToken); + Task GetFile(string path, SyncTarget target, IProgress progress, CancellationToken cancellationToken); + + /// + /// Gets the full path. + /// + /// The path. + /// The target. + /// System.String. + string GetFullPath(IEnumerable path, SyncTarget target); + + /// + /// Gets the parent directory path. + /// + /// The path. + /// The target. + /// System.String. + string GetParentDirectoryPath(string path, SyncTarget target); + + /// + /// Gets the file system entries. + /// + /// The path. + /// The target. + /// Task<List<DeviceFileInfo>>. + Task> GetFileSystemEntries(string path, SyncTarget target); + + /// + /// Gets the data provider. + /// + /// ISyncDataProvider. + ISyncDataProvider GetDataProvider(); + + /// + /// Gets all synchronize targets. + /// + /// IEnumerable<SyncTarget>. + IEnumerable GetAllSyncTargets(); } } diff --git a/MediaBrowser.Controller/Sync/ISyncDataProvider.cs b/MediaBrowser.Controller/Sync/ISyncDataProvider.cs new file mode 100644 index 0000000000..cf698dd3c0 --- /dev/null +++ b/MediaBrowser.Controller/Sync/ISyncDataProvider.cs @@ -0,0 +1,41 @@ +using MediaBrowser.Model.Sync; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace MediaBrowser.Controller.Sync +{ + public interface ISyncDataProvider + { + /// + /// Gets the server item ids. + /// + /// The target. + /// The server identifier. + /// Task<List<System.String>>. + Task> GetServerItemIds(SyncTarget target, string serverId); + + /// + /// Adds the or update. + /// + /// The target. + /// The item. + /// Task. + Task AddOrUpdate(SyncTarget target, LocalItem item); + + /// + /// Deletes the specified identifier. + /// + /// The target. + /// The identifier. + /// Task. + Task Delete(SyncTarget target, string id); + + /// + /// Gets the specified identifier. + /// + /// The target. + /// The identifier. + /// Task<LocalItem>. + Task Get(SyncTarget target, string id); + } +} diff --git a/MediaBrowser.Controller/Sync/ISyncProvider.cs b/MediaBrowser.Controller/Sync/ISyncProvider.cs index 6f24eac1ae..ba6e54d459 100644 --- a/MediaBrowser.Controller/Sync/ISyncProvider.cs +++ b/MediaBrowser.Controller/Sync/ISyncProvider.cs @@ -18,13 +18,6 @@ namespace MediaBrowser.Controller.Sync /// The user identifier. /// IEnumerable<SyncTarget>. IEnumerable GetSyncTargets(string userId); - - /// - /// Gets the device profile. - /// - /// The target. - /// DeviceProfile. - DeviceProfile GetDeviceProfile(SyncTarget target); } public interface IHasUniqueTargetIds -- cgit v1.2.3