You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jellyfin/MediaBrowser.Controller/Sync/IServerSyncProvider.cs

78 lines
3.2 KiB

using MediaBrowser.Model.Querying;
using MediaBrowser.Model.Sync;
using Interfaces.IO;
10 years ago
using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
namespace MediaBrowser.Controller.Sync
{
public interface IServerSyncProvider : ISyncProvider
{
/// <summary>
10 years ago
/// Transfers the file.
/// </summary>
/// <param name="stream">The stream.</param>
/// <param name="pathParts">The path parts.</param>
/// <param name="target">The target.</param>
10 years ago
/// <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>
10 years ago
/// Gets the file.
/// </summary>
/// <param name="id">The identifier.</param>
/// <param name="target">The target.</param>
10 years ago
/// <param name="progress">The progress.</param>
/// <param name="cancellationToken">The cancellation token.</param>
10 years ago
/// <returns>Task&lt;Stream&gt;.</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&lt;QueryResult&lt;FileMetadata&gt;&gt;.</returns>
Task<QueryResult<FileMetadata>> GetFiles(FileQuery query, SyncTarget target, CancellationToken cancellationToken);
}
10 years ago
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);
}
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);
}
}