2014-12-11 07:20:28 +01:00
|
|
|
|
using MediaBrowser.Controller.Entities;
|
2015-02-03 19:14:53 +01:00
|
|
|
|
using MediaBrowser.Controller.Entities.Audio;
|
2014-12-13 04:56:30 +01:00
|
|
|
|
using MediaBrowser.Model.Dlna;
|
2015-01-21 04:54:45 +01:00
|
|
|
|
using MediaBrowser.Model.Events;
|
2014-07-22 18:36:34 +02:00
|
|
|
|
using MediaBrowser.Model.Querying;
|
2014-07-15 06:12:26 +02:00
|
|
|
|
using MediaBrowser.Model.Sync;
|
2014-12-31 07:24:49 +01:00
|
|
|
|
using MediaBrowser.Model.Users;
|
2015-01-21 04:54:45 +01:00
|
|
|
|
using System;
|
2014-07-15 06:12:26 +02:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.Sync
|
|
|
|
|
{
|
|
|
|
|
public interface ISyncManager
|
|
|
|
|
{
|
2015-01-28 05:04:26 +01:00
|
|
|
|
event EventHandler<GenericEventArgs<SyncJobCreationResult>> SyncJobCreated;
|
2015-01-21 04:54:45 +01:00
|
|
|
|
event EventHandler<GenericEventArgs<SyncJob>> SyncJobCancelled;
|
|
|
|
|
|
2014-07-15 06:12:26 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Creates the job.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="request">The request.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
2014-07-26 19:30:15 +02:00
|
|
|
|
Task<SyncJobCreationResult> CreateJob(SyncJobRequest request);
|
2014-07-15 06:12:26 +02:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the jobs.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns>QueryResult<SyncJob>.</returns>
|
2014-12-31 07:24:49 +01:00
|
|
|
|
Task<QueryResult<SyncJob>> GetJobs(SyncJobQuery query);
|
2014-07-15 06:12:26 +02:00
|
|
|
|
|
2014-12-17 06:52:34 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the job items.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="query">The query.</param>
|
|
|
|
|
/// <returns>QueryResult<SyncJobItem>.</returns>
|
|
|
|
|
QueryResult<SyncJobItem> GetJobItems(SyncJobItemQuery query);
|
|
|
|
|
|
2014-07-18 00:21:35 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the job.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id">The identifier.</param>
|
|
|
|
|
/// <returns>SyncJob.</returns>
|
|
|
|
|
SyncJob GetJob(string id);
|
2014-12-13 04:56:30 +01:00
|
|
|
|
|
2014-12-31 07:24:49 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Updates the job.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="job">The job.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
Task UpdateJob(SyncJob job);
|
|
|
|
|
|
2015-01-21 04:54:45 +01: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);
|
|
|
|
|
|
2014-07-15 06:12:26 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Cancels the job.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id">The identifier.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
Task CancelJob(string id);
|
|
|
|
|
|
2014-07-22 03:29:06 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Adds the parts.
|
|
|
|
|
/// </summary>
|
|
|
|
|
void AddParts(IEnumerable<ISyncProvider> providers);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the synchronize targets.
|
|
|
|
|
/// </summary>
|
2014-07-22 18:36:34 +02: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-13 04:56:30 +01:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the device profile.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="targetId">The target identifier.</param>
|
|
|
|
|
/// <returns>DeviceProfile.</returns>
|
|
|
|
|
DeviceProfile GetDeviceProfile(string targetId);
|
2014-12-17 06:30:31 +01: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 18:45:06 +01:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Reports the offline action.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="action">The action.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
Task ReportOfflineAction(UserAction action);
|
2014-12-27 23:52:41 +01:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the ready synchronize items.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="targetId">The target identifier.</param>
|
|
|
|
|
/// <returns>List<SyncedItem>.</returns>
|
|
|
|
|
List<SyncedItem> GetReadySyncItems(string targetId);
|
2014-12-29 06:56:55 +01:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Synchronizes the data.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="request">The request.</param>
|
|
|
|
|
/// <returns>Task<SyncDataResponse>.</returns>
|
|
|
|
|
Task<SyncDataResponse> SyncData(SyncDataRequest request);
|
2015-01-21 05:56:00 +01: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 20:03:55 +01:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the library item ids.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="query">The query.</param>
|
|
|
|
|
/// <returns>QueryResult<System.String>.</returns>
|
|
|
|
|
QueryResult<string> GetLibraryItemIds(SyncJobItemQuery query);
|
2015-02-03 19:14:53 +01:00
|
|
|
|
|
|
|
|
|
/// <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);
|
2014-07-15 06:12:26 +02:00
|
|
|
|
}
|
|
|
|
|
}
|