jellyfin/MediaBrowser.Controller/Sync/IServerSyncProvider.cs

78 lines
3.2 KiB
C#
Raw Normal View History

2015-04-13 07:12:02 +02:00
using MediaBrowser.Model.Querying;
using MediaBrowser.Model.Sync;
2015-04-15 05:41:29 +02:00
using Interfaces.IO;
2015-02-26 21:06:42 +01:00
using System;
using System.IO;
2015-02-05 06:29:37 +01:00
using System.Threading;
using System.Threading.Tasks;
namespace MediaBrowser.Controller.Sync
{
public interface IServerSyncProvider : ISyncProvider
{
/// <summary>
2015-02-26 21:06:42 +01:00
/// Transfers the file.
2015-02-05 06:29:37 +01:00
/// </summary>
2015-03-08 05:44:31 +01:00
/// <param name="stream">The stream.</param>
2015-04-13 07:12:02 +02:00
/// <param name="pathParts">The path parts.</param>
2015-02-05 06:29:37 +01:00
/// <param name="target">The target.</param>
2015-02-26 21:06:42 +01:00
/// <param name="progress">The progress.</param>
2015-02-05 06:29:37 +01:00
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
2015-04-13 07:12:02 +02:00
Task<SyncedFileInfo> SendFile(Stream stream, string[] pathParts, SyncTarget target, IProgress<double> progress, CancellationToken cancellationToken);
2015-02-28 14:42:47 +01:00
/// <summary>
/// Deletes the file.
/// </summary>
2015-04-13 07:12:02 +02:00
/// <param name="id">The identifier.</param>
2015-02-28 14:42:47 +01:00
/// <param name="target">The target.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
2015-04-13 07:12:02 +02:00
Task DeleteFile(string id, SyncTarget target, CancellationToken cancellationToken);
2015-02-05 06:29:37 +01:00
/// <summary>
2015-02-26 21:06:42 +01:00
/// Gets the file.
2015-02-05 06:29:37 +01:00
/// </summary>
2015-04-13 07:12:02 +02:00
/// <param name="id">The identifier.</param>
2015-02-05 06:29:37 +01:00
/// <param name="target">The target.</param>
2015-02-26 21:06:42 +01:00
/// <param name="progress">The progress.</param>
2015-02-05 06:29:37 +01:00
/// <param name="cancellationToken">The cancellation token.</param>
2015-02-26 21:06:42 +01:00
/// <returns>Task&lt;Stream&gt;.</returns>
2015-04-13 07:12:02 +02:00
Task<Stream> GetFile(string id, SyncTarget target, IProgress<double> progress, CancellationToken cancellationToken);
2015-02-28 14:42:47 +01:00
/// <summary>
2015-04-13 07:12:02 +02:00
/// Gets the files.
2015-02-28 14:42:47 +01:00
/// </summary>
2015-04-13 07:12:02 +02:00
/// <param name="query">The query.</param>
2015-02-28 14:42:47 +01:00
/// <param name="target">The target.</param>
2015-04-13 07:12:02 +02:00
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task&lt;QueryResult&lt;FileMetadata&gt;&gt;.</returns>
Task<QueryResult<FileMetadata>> GetFiles(FileQuery query, SyncTarget target, CancellationToken cancellationToken);
2015-02-05 06:29:37 +01:00
}
2015-07-06 09:06:09 +02: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 21:45:41 +02: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 06:29:37 +01:00
}