aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Controller')
-rw-r--r--MediaBrowser.Controller/Drawing/IImageProcessor.cs6
-rw-r--r--MediaBrowser.Controller/MediaBrowser.Controller.csproj2
-rw-r--r--MediaBrowser.Controller/Sync/ICloudSyncProvider.cs46
-rw-r--r--MediaBrowser.Controller/Sync/IServerSyncProvider.cs54
-rw-r--r--MediaBrowser.Controller/Sync/ISyncDataProvider.cs41
-rw-r--r--MediaBrowser.Controller/Sync/ISyncProvider.cs7
6 files changed, 94 insertions, 62 deletions
diff --git a/MediaBrowser.Controller/Drawing/IImageProcessor.cs b/MediaBrowser.Controller/Drawing/IImageProcessor.cs
index 8ac7d56d2..6fafc2b46 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
/// <summary>
/// Gets the size of the image.
/// </summary>
- /// <param name="path">The path.</param>
- /// <param name="imageDateModified">The image date modified.</param>
+ /// <param name="info">The information.</param>
/// <returns>ImageSize.</returns>
- ImageSize GetImageSize(string path, DateTime imageDateModified);
+ ImageSize GetImageSize(ItemImageInfo info);
/// <summary>
/// Adds the parts.
diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj
index e9531e057..603cb02e0 100644
--- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj
+++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj
@@ -341,8 +341,8 @@
<Compile Include="Subtitles\SubtitleDownloadEventArgs.cs" />
<Compile Include="Subtitles\SubtitleResponse.cs" />
<Compile Include="Subtitles\SubtitleSearchRequest.cs" />
- <Compile Include="Sync\ICloudSyncProvider.cs" />
<Compile Include="Sync\IServerSyncProvider.cs" />
+ <Compile Include="Sync\ISyncDataProvider.cs" />
<Compile Include="Sync\ISyncManager.cs" />
<Compile Include="Sync\ISyncProvider.cs" />
<Compile Include="Sync\ISyncRepository.cs" />
diff --git a/MediaBrowser.Controller/Sync/ICloudSyncProvider.cs b/MediaBrowser.Controller/Sync/ICloudSyncProvider.cs
deleted file mode 100644
index 8f03aea0a..000000000
--- 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
- {
- /// <summary>
- /// Gets the name.
- /// </summary>
- /// <value>The name.</value>
- string Name { get; }
-
- /// <summary>
- /// Gets the synchronize targets.
- /// </summary>
- /// <param name="userId">The user identifier.</param>
- /// <returns>IEnumerable&lt;SyncTarget&gt;.</returns>
- IEnumerable<SyncTarget> GetSyncTargets(string userId);
-
- /// <summary>
- /// Transfers the item file.
- /// </summary>
- /// <param name="inputFile">The input file.</param>
- /// <param name="pathParts">The path parts.</param>
- /// <param name="target">The target.</param>
- /// <param name="progress">The progress.</param>
- /// <param name="cancellationToken">The cancellation token.</param>
- /// <returns>Task.</returns>
- Task SendFile(string inputFile, string[] pathParts, SyncTarget target, IProgress<double> progress, CancellationToken cancellationToken);
-
- /// <summary>
- /// Gets the file.
- /// </summary>
- /// <param name="pathParts">The path parts.</param>
- /// <param name="target">The target.</param>
- /// <param name="progress">The progress.</param>
- /// <param name="cancellationToken">The cancellation token.</param>
- /// <returns>Task&lt;Stream&gt;.</returns>
- Task<Stream> GetFile(string[] pathParts, SyncTarget target, IProgress<double> progress, CancellationToken cancellationToken);
- }
-}
diff --git a/MediaBrowser.Controller/Sync/IServerSyncProvider.cs b/MediaBrowser.Controller/Sync/IServerSyncProvider.cs
index b3e74ee7d..9ee83acbf 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.
/// </summary>
/// <param name="inputFile">The input file.</param>
- /// <param name="pathParts">The path parts.</param>
+ /// <param name="path">The path.</param>
/// <param name="target">The target.</param>
/// <param name="progress">The progress.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
- Task SendFile(string inputFile, string[] pathParts, SyncTarget target, IProgress<double> progress, CancellationToken cancellationToken);
+ Task SendFile(string inputFile, string path, SyncTarget target, IProgress<double> progress, CancellationToken cancellationToken);
+
+ /// <summary>
+ /// Deletes the file.
+ /// </summary>
+ /// <param name="path">The path.</param>
+ /// <param name="target">The target.</param>
+ /// <param name="cancellationToken">The cancellation token.</param>
+ /// <returns>Task.</returns>
+ Task DeleteFile(string path, SyncTarget target, CancellationToken cancellationToken);
/// <summary>
/// Gets the file.
/// </summary>
- /// <param name="pathParts">The path parts.</param>
+ /// <param name="path">The path.</param>
/// <param name="target">The target.</param>
/// <param name="progress">The progress.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task&lt;Stream&gt;.</returns>
- Task<Stream> GetFile(string[] pathParts, SyncTarget target, IProgress<double> progress, CancellationToken cancellationToken);
+ Task<Stream> GetFile(string path, SyncTarget target, IProgress<double> progress, CancellationToken cancellationToken);
+
+ /// <summary>
+ /// Gets the full path.
+ /// </summary>
+ /// <param name="path">The path.</param>
+ /// <param name="target">The target.</param>
+ /// <returns>System.String.</returns>
+ string GetFullPath(IEnumerable<string> path, SyncTarget target);
+
+ /// <summary>
+ /// Gets the parent directory path.
+ /// </summary>
+ /// <param name="path">The path.</param>
+ /// <param name="target">The target.</param>
+ /// <returns>System.String.</returns>
+ string GetParentDirectoryPath(string path, SyncTarget target);
+
+ /// <summary>
+ /// Gets the file system entries.
+ /// </summary>
+ /// <param name="path">The path.</param>
+ /// <param name="target">The target.</param>
+ /// <returns>Task&lt;List&lt;DeviceFileInfo&gt;&gt;.</returns>
+ Task<List<DeviceFileInfo>> GetFileSystemEntries(string path, SyncTarget target);
+
+ /// <summary>
+ /// Gets the data provider.
+ /// </summary>
+ /// <returns>ISyncDataProvider.</returns>
+ ISyncDataProvider GetDataProvider();
+
+ /// <summary>
+ /// Gets all synchronize targets.
+ /// </summary>
+ /// <returns>IEnumerable&lt;SyncTarget&gt;.</returns>
+ IEnumerable<SyncTarget> GetAllSyncTargets();
}
}
diff --git a/MediaBrowser.Controller/Sync/ISyncDataProvider.cs b/MediaBrowser.Controller/Sync/ISyncDataProvider.cs
new file mode 100644
index 000000000..cf698dd3c
--- /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
+ {
+ /// <summary>
+ /// Gets the server item ids.
+ /// </summary>
+ /// <param name="target">The target.</param>
+ /// <param name="serverId">The server identifier.</param>
+ /// <returns>Task&lt;List&lt;System.String&gt;&gt;.</returns>
+ Task<List<string>> GetServerItemIds(SyncTarget target, string serverId);
+
+ /// <summary>
+ /// Adds the or update.
+ /// </summary>
+ /// <param name="target">The target.</param>
+ /// <param name="item">The item.</param>
+ /// <returns>Task.</returns>
+ Task AddOrUpdate(SyncTarget target, LocalItem item);
+
+ /// <summary>
+ /// Deletes the specified identifier.
+ /// </summary>
+ /// <param name="target">The target.</param>
+ /// <param name="id">The identifier.</param>
+ /// <returns>Task.</returns>
+ Task Delete(SyncTarget target, string id);
+
+ /// <summary>
+ /// Gets the specified identifier.
+ /// </summary>
+ /// <param name="target">The target.</param>
+ /// <param name="id">The identifier.</param>
+ /// <returns>Task&lt;LocalItem&gt;.</returns>
+ Task<LocalItem> Get(SyncTarget target, string id);
+ }
+}
diff --git a/MediaBrowser.Controller/Sync/ISyncProvider.cs b/MediaBrowser.Controller/Sync/ISyncProvider.cs
index 6f24eac1a..ba6e54d45 100644
--- a/MediaBrowser.Controller/Sync/ISyncProvider.cs
+++ b/MediaBrowser.Controller/Sync/ISyncProvider.cs
@@ -18,13 +18,6 @@ namespace MediaBrowser.Controller.Sync
/// <param name="userId">The user identifier.</param>
/// <returns>IEnumerable&lt;SyncTarget&gt;.</returns>
IEnumerable<SyncTarget> GetSyncTargets(string userId);
-
- /// <summary>
- /// Gets the device profile.
- /// </summary>
- /// <param name="target">The target.</param>
- /// <returns>DeviceProfile.</returns>
- DeviceProfile GetDeviceProfile(SyncTarget target);
}
public interface IHasUniqueTargetIds