mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-07 11:57:55 +02:00
66 lines
2.8 KiB
C#
66 lines
2.8 KiB
C#
using MediaBrowser.Model.Querying;
|
|
using MediaBrowser.Model.Sync;
|
|
using Interfaces.IO;
|
|
using System;
|
|
using System.IO;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace MediaBrowser.Controller.Sync
|
|
{
|
|
public interface IServerSyncProvider : ISyncProvider
|
|
{
|
|
/// <summary>
|
|
/// Transfers the file.
|
|
/// </summary>
|
|
/// <param name="stream">The stream.</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<SyncedFileInfo> SendFile(Stream stream, string[] pathParts, SyncTarget target, IProgress<double> progress, CancellationToken cancellationToken);
|
|
|
|
/// <summary>
|
|
/// Deletes the file.
|
|
/// </summary>
|
|
/// <param name="id">The identifier.</param>
|
|
/// <param name="target">The target.</param>
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
/// <returns>Task.</returns>
|
|
Task DeleteFile(string id, SyncTarget target, CancellationToken cancellationToken);
|
|
|
|
/// <summary>
|
|
/// Gets the file.
|
|
/// </summary>
|
|
/// <param name="id">The identifier.</param>
|
|
/// <param name="target">The target.</param>
|
|
/// <param name="progress">The progress.</param>
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
/// <returns>Task<Stream>.</returns>
|
|
Task<Stream> GetFile(string id, SyncTarget target, IProgress<double> progress, CancellationToken cancellationToken);
|
|
|
|
/// <summary>
|
|
/// Gets the files.
|
|
/// </summary>
|
|
/// <param name="query">The query.</param>
|
|
/// <param name="target">The target.</param>
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
/// <returns>Task<QueryResult<FileMetadata>>.</returns>
|
|
Task<QueryResult<FileMetadata>> GetFiles(FileQuery query, SyncTarget target, CancellationToken cancellationToken);
|
|
}
|
|
|
|
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<SyncedFileInfo>.</returns>
|
|
Task<SyncedFileInfo> SendFile(string path, string[] pathParts, SyncTarget target, IProgress<double> progress, CancellationToken cancellationToken);
|
|
}
|
|
}
|