jellyfin/MediaBrowser.Controller/Sync/IServerSyncProvider.cs

72 lines
3.0 KiB
C#
Raw Normal View History

2015-04-13 05:12:02 +00:00
using MediaBrowser.Model.Querying;
using MediaBrowser.Model.Sync;
2015-02-26 20:06:42 +00:00
using System;
using System.IO;
2015-02-05 05:29:37 +00:00
using System.Threading;
using System.Threading.Tasks;
2016-10-29 18:44:50 +00:00
using MediaBrowser.Model.IO;
2015-02-05 05:29:37 +00:00
namespace MediaBrowser.Controller.Sync
{
public interface IServerSyncProvider : ISyncProvider
{
/// <summary>
2015-02-26 20:06:42 +00:00
/// Transfers the file.
2015-02-05 05:29:37 +00:00
/// </summary>
2015-03-08 04:44:31 +00:00
/// <param name="stream">The stream.</param>
2015-04-13 05:12:02 +00:00
/// <param name="pathParts">The path parts.</param>
2015-02-05 05:29:37 +00:00
/// <param name="target">The target.</param>
2015-02-26 20:06:42 +00:00
/// <param name="progress">The progress.</param>
2015-02-05 05:29:37 +00:00
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
2015-04-13 05:12:02 +00:00
Task<SyncedFileInfo> SendFile(Stream stream, string[] pathParts, SyncTarget target, IProgress<double> progress, CancellationToken cancellationToken);
2015-02-28 13:42:47 +00:00
/// <summary>
/// Deletes the file.
/// </summary>
2015-04-13 05:12:02 +00:00
/// <param name="id">The identifier.</param>
2015-02-28 13:42:47 +00:00
/// <param name="target">The target.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
2015-04-13 05:12:02 +00:00
Task DeleteFile(string id, SyncTarget target, CancellationToken cancellationToken);
2015-02-05 05:29:37 +00:00
/// <summary>
2015-02-26 20:06:42 +00:00
/// Gets the file.
2015-02-05 05:29:37 +00:00
/// </summary>
2015-04-13 05:12:02 +00:00
/// <param name="id">The identifier.</param>
2015-02-05 05:29:37 +00:00
/// <param name="target">The target.</param>
2015-02-26 20:06:42 +00:00
/// <param name="progress">The progress.</param>
2015-02-05 05:29:37 +00:00
/// <param name="cancellationToken">The cancellation token.</param>
2015-02-26 20:06:42 +00:00
/// <returns>Task&lt;Stream&gt;.</returns>
2015-04-13 05:12:02 +00:00
Task<Stream> GetFile(string id, SyncTarget target, IProgress<double> progress, CancellationToken cancellationToken);
2015-02-28 13:42:47 +00:00
2016-10-29 18:44:50 +00:00
Task<QueryResult<FileSystemMetadata>> GetFiles(string[] pathParts, SyncTarget target, CancellationToken cancellationToken);
2016-10-29 20:02:21 +00:00
Task<QueryResult<FileSystemMetadata>> GetFiles(SyncTarget target, CancellationToken cancellationToken);
2015-02-05 05:29:37 +00:00
}
2015-07-06 07:06:09 +00:00
public interface ISupportsDirectCopy
{
/// <summary>
/// Sends the file.
/// </summary>
/// <param name="path">The path.</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&lt;SyncedFileInfo&gt;.</returns>
Task<SyncedFileInfo> SendFile(string path, string[] pathParts, SyncTarget target, IProgress<double> progress, CancellationToken cancellationToken);
}
2015-08-18 19:45:41 +00:00
public interface IHasDuplicateCheck
{
/// <summary>
/// Allows the duplicate job item.
/// </summary>
/// <param name="original">The original.</param>
/// <param name="duplicate">The duplicate.</param>
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
bool AllowDuplicateJobItem(SyncJobItem original, SyncJobItem duplicate);
}
2015-02-05 05:29:37 +00:00
}