jellyfin/MediaBrowser.Controller/Sync/IServerSyncProvider.cs

67 lines
2.8 KiB
C#
Raw Normal View History

2015-04-13 05:12:02 +00:00
using MediaBrowser.Model.Querying;
using MediaBrowser.Model.Sync;
2015-04-15 03:41:29 +00:00
using Interfaces.IO;
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;
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
/// <summary>
2015-04-13 05:12:02 +00:00
/// Gets the files.
2015-02-28 13:42:47 +00:00
/// </summary>
2015-04-13 05:12:02 +00:00
/// <param name="query">The query.</param>
2015-02-28 13:42:47 +00:00
/// <param name="target">The target.</param>
2015-04-13 05:12:02 +00: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 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-02-05 05:29:37 +00:00
}