jellyfin/MediaBrowser.Controller/Sync/ISyncManager.cs

199 lines
6.9 KiB
C#
Raw Normal View History

2014-12-10 23:20:28 -07:00
using MediaBrowser.Controller.Entities;
2015-01-20 20:54:45 -07:00
using MediaBrowser.Model.Events;
2014-07-22 09:36:34 -07:00
using MediaBrowser.Model.Querying;
2014-07-14 21:12:26 -07:00
using MediaBrowser.Model.Sync;
2014-12-30 23:24:49 -07:00
using MediaBrowser.Model.Users;
2015-01-20 20:54:45 -07:00
using System;
2014-07-14 21:12:26 -07:00
using System.Collections.Generic;
using System.Threading.Tasks;
namespace MediaBrowser.Controller.Sync
{
public interface ISyncManager
{
2015-01-27 21:04:26 -07:00
event EventHandler<GenericEventArgs<SyncJobCreationResult>> SyncJobCreated;
2015-01-20 20:54:45 -07:00
event EventHandler<GenericEventArgs<SyncJob>> SyncJobCancelled;
2015-02-04 12:13:00 -07:00
event EventHandler<GenericEventArgs<SyncJob>> SyncJobUpdated;
2015-02-04 20:01:37 -07:00
event EventHandler<GenericEventArgs<SyncJobItem>> SyncJobItemUpdated;
event EventHandler<GenericEventArgs<SyncJobItem>> SyncJobItemCreated;
2014-07-14 21:12:26 -07:00
/// <summary>
/// Creates the job.
/// </summary>
/// <param name="request">The request.</param>
/// <returns>Task.</returns>
2014-07-26 10:30:15 -07:00
Task<SyncJobCreationResult> CreateJob(SyncJobRequest request);
2014-07-14 21:12:26 -07:00
/// <summary>
/// Gets the jobs.
/// </summary>
/// <returns>QueryResult&lt;SyncJob&gt;.</returns>
2014-12-30 23:24:49 -07:00
Task<QueryResult<SyncJob>> GetJobs(SyncJobQuery query);
2014-07-14 21:12:26 -07:00
2014-12-16 22:52:34 -07:00
/// <summary>
/// Gets the job items.
/// </summary>
/// <param name="query">The query.</param>
/// <returns>QueryResult&lt;SyncJobItem&gt;.</returns>
QueryResult<SyncJobItem> GetJobItems(SyncJobItemQuery query);
2015-02-04 20:01:37 -07:00
2014-07-17 15:21:35 -07:00
/// <summary>
/// Gets the job.
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns>SyncJob.</returns>
SyncJob GetJob(string id);
2014-12-12 20:56:30 -07:00
2014-12-30 23:24:49 -07:00
/// <summary>
/// Updates the job.
/// </summary>
/// <param name="job">The job.</param>
/// <returns>Task.</returns>
Task UpdateJob(SyncJob job);
2015-01-20 20:54:45 -07:00
/// <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);
2015-02-04 20:01:37 -07:00
2014-07-14 21:12:26 -07:00
/// <summary>
/// Cancels the job.
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns>Task.</returns>
Task CancelJob(string id);
2015-04-03 18:24:49 -07:00
/// <summary>
/// Cancels the items.
/// </summary>
/// <param name="targetId">The target identifier.</param>
/// <param name="itemIds">The item ids.</param>
/// <returns>Task.</returns>
Task CancelItems(string targetId, IEnumerable<string> itemIds);
2014-07-21 18:29:06 -07:00
/// <summary>
/// Adds the parts.
/// </summary>
void AddParts(IEnumerable<ISyncProvider> providers);
/// <summary>
/// Gets the synchronize targets.
/// </summary>
2014-07-22 09:36:34 -07:00
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);
2014-12-12 20:56:30 -07:00
2014-12-16 22:30:31 -07:00
/// <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);
2014-12-26 10:45:06 -07:00
/// <summary>
/// Reports the offline action.
/// </summary>
/// <param name="action">The action.</param>
/// <returns>Task.</returns>
Task ReportOfflineAction(UserAction action);
2014-12-27 15:52:41 -07:00
/// <summary>
/// Gets the ready synchronize items.
/// </summary>
/// <param name="targetId">The target identifier.</param>
/// <returns>List&lt;SyncedItem&gt;.</returns>
2015-02-19 10:46:18 -07:00
Task<List<SyncedItem>> GetReadySyncItems(string targetId);
2014-12-28 22:56:55 -07:00
/// <summary>
/// Synchronizes the data.
/// </summary>
/// <param name="request">The request.</param>
/// <returns>Task&lt;SyncDataResponse&gt;.</returns>
Task<SyncDataResponse> SyncData(SyncDataRequest request);
2015-01-20 21:56:00 -07:00
/// <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);
2015-01-24 12:03:55 -07:00
/// <summary>
/// Gets the library item ids.
/// </summary>
/// <param name="query">The query.</param>
/// <returns>QueryResult&lt;System.String&gt;.</returns>
2016-08-02 23:38:19 -07:00
Dictionary<string, SyncedItemProgress> GetSyncedItemProgresses(SyncJobItemQuery query);
2015-02-03 11:14:53 -07:00
2015-02-04 22:29:37 -07:00
/// <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);
2015-03-11 21:47:16 -07:00
/// <summary>
/// Gets the quality options.
/// </summary>
/// <param name="targetId">The target identifier.</param>
/// <returns>IEnumerable&lt;SyncQualityOption&gt;.</returns>
IEnumerable<SyncQualityOption> GetQualityOptions(string targetId);
2015-04-05 08:01:57 -07:00
/// <summary>
/// Gets the quality options.
/// </summary>
/// <param name="targetId">The target identifier.</param>
/// <param name="user">The user.</param>
/// <returns>IEnumerable&lt;SyncQualityOption&gt;.</returns>
IEnumerable<SyncQualityOption> GetQualityOptions(string targetId, User user);
2015-03-14 18:42:09 -07:00
/// <summary>
/// Gets the profile options.
/// </summary>
/// <param name="targetId">The target identifier.</param>
/// <returns>IEnumerable&lt;SyncQualityOption&gt;.</returns>
2015-03-14 21:17:35 -07:00
IEnumerable<SyncProfileOption> GetProfileOptions(string targetId);
2015-04-05 08:01:57 -07:00
/// <summary>
/// Gets the profile options.
/// </summary>
/// <param name="targetId">The target identifier.</param>
/// <param name="user">The user.</param>
/// <returns>IEnumerable&lt;SyncProfileOption&gt;.</returns>
IEnumerable<SyncProfileOption> GetProfileOptions(string targetId, User user);
2014-07-14 21:12:26 -07:00
}
}