mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-17 15:53:42 +01:00
rework server sync
This commit is contained in:
@@ -9,10 +9,10 @@ namespace MediaBrowser.Controller.Sync
|
||||
/// <summary>
|
||||
/// Gets the synced file information.
|
||||
/// </summary>
|
||||
/// <param name="remotePath">The remote path.</param>
|
||||
/// <param name="id">The identifier.</param>
|
||||
/// <param name="target">The target.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task<SyncedFileInfo>.</returns>
|
||||
Task<SyncedFileInfo> GetSyncedFileInfo(string remotePath, SyncTarget target, CancellationToken cancellationToken);
|
||||
Task<SyncedFileInfo> GetSyncedFileInfo(string id, SyncTarget target, CancellationToken cancellationToken);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using MediaBrowser.Model.Sync;
|
||||
using MediaBrowser.Model.Querying;
|
||||
using MediaBrowser.Model.Sync;
|
||||
using Patterns.IO;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
@@ -13,46 +14,39 @@ namespace MediaBrowser.Controller.Sync
|
||||
/// Transfers the file.
|
||||
/// </summary>
|
||||
/// <param name="stream">The stream.</param>
|
||||
/// <param name="remotePath">The remote 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.</returns>
|
||||
Task<SyncedFileInfo> SendFile(Stream stream, string remotePath, SyncTarget target, IProgress<double> progress, CancellationToken cancellationToken);
|
||||
Task<SyncedFileInfo> SendFile(Stream stream, string[] pathParts, SyncTarget target, IProgress<double> progress, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes the file.
|
||||
/// </summary>
|
||||
/// <param name="path">The path.</param>
|
||||
/// <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 path, SyncTarget target, CancellationToken cancellationToken);
|
||||
Task DeleteFile(string id, SyncTarget target, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the file.
|
||||
/// </summary>
|
||||
/// <param name="path">The path.</param>
|
||||
/// <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 path, SyncTarget target, IProgress<double> progress, CancellationToken cancellationToken);
|
||||
Task<Stream> GetFile(string id, SyncTarget target, IProgress<double> progress, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the full path.
|
||||
/// Gets the files.
|
||||
/// </summary>
|
||||
/// <param name="path">The path.</param>
|
||||
/// <param name="query">The query.</param>
|
||||
/// <param name="target">The target.</param>
|
||||
/// <returns>System.String.</returns>
|
||||
string GetFullPath(IEnumerable<string> path, SyncTarget target);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the parent directory path.
|
||||
/// </summary>
|
||||
/// <param name="path">The path.</param>
|
||||
/// <param name="target">The target.</param>
|
||||
/// <returns>System.String.</returns>
|
||||
string GetParentDirectoryPath(string path, SyncTarget target);
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task<QueryResult<FileMetadata>>.</returns>
|
||||
Task<QueryResult<FileMetadata>> GetFiles(FileQuery query, SyncTarget target, CancellationToken cancellationToken);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,20 +7,12 @@ namespace MediaBrowser.Controller.Sync
|
||||
public interface ISyncDataProvider
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the server item ids.
|
||||
/// Gets the local items.
|
||||
/// </summary>
|
||||
/// <param name="target">The target.</param>
|
||||
/// <param name="serverId">The server identifier.</param>
|
||||
/// <returns>Task<List<System.String>>.</returns>
|
||||
Task<List<string>> GetServerItemIds(SyncTarget target, string serverId);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the synchronize job item ids.
|
||||
/// </summary>
|
||||
/// <param name="target">The target.</param>
|
||||
/// <param name="serverId">The server identifier.</param>
|
||||
/// <returns>Task<List<System.String>>.</returns>
|
||||
Task<List<string>> GetSyncJobItemIds(SyncTarget target, string serverId);
|
||||
/// <returns>Task<List<LocalItem>>.</returns>
|
||||
Task<List<LocalItem>> GetLocalItems(SyncTarget target, string serverId);
|
||||
|
||||
/// <summary>
|
||||
/// Adds the or update.
|
||||
|
||||
@@ -20,6 +20,11 @@ namespace MediaBrowser.Controller.Sync
|
||||
/// </summary>
|
||||
/// <value>The required HTTP headers.</value>
|
||||
public Dictionary<string, string> RequiredHttpHeaders { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the identifier.
|
||||
/// </summary>
|
||||
/// <value>The identifier.</value>
|
||||
public string Id { get; set; }
|
||||
|
||||
public SyncedFileInfo()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user