The Free Software Media System - Server Backend & API
update sync cancellation
Luke Pulverenti28bbe32d1dc5
diff --git a/Emby.Server.Implementations/Sync/SyncManager.cs b/Emby.Server.Implementations/Sync/SyncManager.csindex 061129e5f9..d3b6b33a27 100644--- a/Emby.Server.Implementations/Sync/SyncManager.cs+++ b/Emby.Server.Implementations/Sync/SyncManager.cs@@ -1030,6 +1030,18 @@ namespace Emby.Server.Implementations.Sync{await CancelJobItem(jobItem.Id).ConfigureAwait(false);}++ var syncJobResult = await GetJobs(new SyncJobQuery+ {+ ItemId = item,+ TargetId = targetId++ }).ConfigureAwait(false);++ foreach (var job in syncJobResult.Items)+ {+ await CancelJob(job.Id).ConfigureAwait(false);+ }}}diff --git a/Emby.Server.Implementations/Sync/SyncRepository.cs b/Emby.Server.Implementations/Sync/SyncRepository.csindex ad4222ba6a..aafce3500f 100644--- a/Emby.Server.Implementations/Sync/SyncRepository.cs+++ b/Emby.Server.Implementations/Sync/SyncRepository.cs@@ -360,6 +360,11 @@ namespace Emby.Server.Implementations.SyncwhereClauses.Add("UserId=?");paramList.Add(query.UserId);}+ if (!string.IsNullOrWhiteSpace(query.ItemId))+ {+ whereClauses.Add("ItemIds like ?");+ paramList.Add("%" + query.ItemId + "%");+ }if (query.SyncNewContent.HasValue){whereClauses.Add("SyncNewContent=?");diff --git a/MediaBrowser.Model/Sync/SyncJobQuery.cs b/MediaBrowser.Model/Sync/SyncJobQuery.csindex bb99b5d5f3..ed9e5ae605 100644--- a/MediaBrowser.Model/Sync/SyncJobQuery.cs+++ b/MediaBrowser.Model/Sync/SyncJobQuery.cs@@ -24,6 +24,7 @@ namespace MediaBrowser.Model.Sync/// <value>The user identifier.</value>public string UserId { get; set; }public string ExcludeTargetIds { get; set; }+ public string ItemId { get; set; }/// <summary>/// Gets or sets the status./// </summary>