jellyfin/MediaBrowser.Controller/Sync/IServerSyncProvider.cs

78 lines
3.2 KiB
C#
Raw Normal View History

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