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/ISyncManager.cs

186 lines
6.1 KiB

using MediaBrowser.Controller.Entities;
using MediaBrowser.Model.Dlna;
10 years ago
using MediaBrowser.Model.Events;
using MediaBrowser.Model.Querying;
using MediaBrowser.Model.Sync;
using MediaBrowser.Model.Users;
10 years ago
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace MediaBrowser.Controller.Sync
{
public interface ISyncManager
{
event EventHandler<GenericEventArgs<SyncJobCreationResult>> SyncJobCreated;
10 years ago
event EventHandler<GenericEventArgs<SyncJob>> SyncJobCancelled;
10 years ago
event EventHandler<GenericEventArgs<SyncJob>> SyncJobUpdated;
10 years ago
event EventHandler<GenericEventArgs<SyncJobItem>> SyncJobItemUpdated;
event EventHandler<GenericEventArgs<SyncJobItem>> SyncJobItemCreated;
/// <summary>
/// Creates the job.
/// </summary>
/// <param name="request">The request.</param>
/// <returns>Task.</returns>
Task<SyncJobCreationResult> CreateJob(SyncJobRequest request);
/// <summary>
/// Gets the jobs.
/// </summary>
/// <returns>QueryResult&lt;SyncJob&gt;.</returns>
Task<QueryResult<SyncJob>> GetJobs(SyncJobQuery query);
/// <summary>
/// Gets the job items.
/// </summary>
/// <param name="query">The query.</param>
/// <returns>QueryResult&lt;SyncJobItem&gt;.</returns>
QueryResult<SyncJobItem> GetJobItems(SyncJobItemQuery query);
10 years ago
/// <summary>
/// Gets the job.
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns>SyncJob.</returns>
SyncJob GetJob(string id);
/// <summary>
/// Updates the job.
/// </summary>
/// <param name="job">The job.</param>
/// <returns>Task.</returns>
Task UpdateJob(SyncJob job);
10 years ago
/// <summary>
/// Res the enable job item.
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns>Task.</returns>
Task ReEnableJobItem(string id);
/// <summary>
/// Cnacels the job item.
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns>Task.</returns>
Task CancelJobItem(string id);
10 years ago
/// <summary>
/// Cancels the job.
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns>Task.</returns>
Task CancelJob(string id);
/// <summary>
/// Adds the parts.
/// </summary>
void AddParts(IEnumerable<ISyncProvider> providers);
/// <summary>
/// Gets the synchronize targets.
/// </summary>
IEnumerable<SyncTarget> GetSyncTargets(string userId);
/// <summary>
/// Supportses the synchronize.
/// </summary>
/// <param name="item">The item.</param>
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
bool SupportsSync(BaseItem item);
/// <summary>
/// Gets the device profile.
/// </summary>
/// <param name="targetId">The target identifier.</param>
/// <returns>DeviceProfile.</returns>
DeviceProfile GetDeviceProfile(string targetId);
10 years ago
/// <summary>
/// Reports the synchronize job item transferred.
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns>Task.</returns>
Task ReportSyncJobItemTransferred(string id);
/// <summary>
/// Gets the job item.
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns>SyncJobItem.</returns>
SyncJobItem GetJobItem(string id);
10 years ago
/// <summary>
/// Reports the offline action.
/// </summary>
/// <param name="action">The action.</param>
/// <returns>Task.</returns>
Task ReportOfflineAction(UserAction action);
10 years ago
/// <summary>
/// Gets the ready synchronize items.
/// </summary>
/// <param name="targetId">The target identifier.</param>
/// <returns>List&lt;SyncedItem&gt;.</returns>
List<SyncedItem> GetReadySyncItems(string targetId);
10 years ago
/// <summary>
/// Synchronizes the data.
/// </summary>
/// <param name="request">The request.</param>
/// <returns>Task&lt;SyncDataResponse&gt;.</returns>
Task<SyncDataResponse> SyncData(SyncDataRequest request);
/// <summary>
/// Marks the job item for removal.
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns>Task.</returns>
Task MarkJobItemForRemoval(string id);
/// <summary>
/// Unmarks the job item for removal.
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns>Task.</returns>
Task UnmarkJobItemForRemoval(string id);
10 years ago
/// <summary>
/// Gets the library item ids.
/// </summary>
/// <param name="query">The query.</param>
/// <returns>QueryResult&lt;System.String&gt;.</returns>
QueryResult<string> GetLibraryItemIds(SyncJobItemQuery query);
10 years ago
/// <summary>
/// Gets the audio options.
/// </summary>
/// <param name="jobItem">The job item.</param>
/// <returns>AudioOptions.</returns>
AudioOptions GetAudioOptions(SyncJobItem jobItem);
/// <summary>
/// Gets the video options.
/// </summary>
/// <param name="jobItem">The job item.</param>
/// <param name="job">The job.</param>
/// <returns>VideoOptions.</returns>
VideoOptions GetVideoOptions(SyncJobItem jobItem, SyncJob job);
/// <summary>
/// Reports the synchronize job item transfer beginning.
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns>Task.</returns>
Task ReportSyncJobItemTransferBeginning(string id);
/// <summary>
/// Reports the synchronize job item transfer failed.
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns>Task.</returns>
Task ReportSyncJobItemTransferFailed(string id);
}
}