diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-12-28 03:16:21 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-12-28 03:16:21 -0500 |
| commit | 28bbe32d1dc50ce7ad199f50acb5b2b4791b1b4c (patch) | |
| tree | 6432806f1c2f95ce9201c2d15aac3245b4fd4f46 | |
| parent | 0fd7e89039265ffa6dccaa2a029377e74d0c6057 (diff) | |
update sync cancellation
| -rw-r--r-- | Emby.Server.Implementations/Sync/SyncManager.cs | 12 | ||||
| -rw-r--r-- | Emby.Server.Implementations/Sync/SyncRepository.cs | 5 | ||||
| -rw-r--r-- | MediaBrowser.Model/Sync/SyncJobQuery.cs | 1 |
3 files changed, 18 insertions, 0 deletions
diff --git a/Emby.Server.Implementations/Sync/SyncManager.cs b/Emby.Server.Implementations/Sync/SyncManager.cs index 061129e5f..d3b6b33a2 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.cs index ad4222ba6..aafce3500 100644 --- a/Emby.Server.Implementations/Sync/SyncRepository.cs +++ b/Emby.Server.Implementations/Sync/SyncRepository.cs @@ -360,6 +360,11 @@ namespace Emby.Server.Implementations.Sync whereClauses.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.cs index bb99b5d5f..ed9e5ae60 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> |
