aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2016-12-28 14:42:52 -0500
committerGitHub <noreply@github.com>2016-12-28 14:42:52 -0500
commitbda4afeede5fee042705fdf53a42ac30d8522107 (patch)
tree6e0a2b5a879ed1accb15802492a9e269e37f3f60
parent9b20d28f5029a0da5b7e51d1eab5967b5610fb1e (diff)
parentdb9eb64e9fe9453172052be0d2923cdb83bdca6a (diff)
Merge pull request #2369 from MediaBrowser/dev
Dev
-rw-r--r--Emby.Server.Implementations/Sync/SyncManager.cs12
-rw-r--r--Emby.Server.Implementations/Sync/SyncRepository.cs5
-rw-r--r--MediaBrowser.Api/Playback/BaseStreamingService.cs18
-rw-r--r--MediaBrowser.Model/Sync/SyncJobQuery.cs1
4 files changed, 29 insertions, 7 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.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs
index 42ca927a1..7f568183e 100644
--- a/MediaBrowser.Api/Playback/BaseStreamingService.cs
+++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs
@@ -1967,10 +1967,15 @@ namespace MediaBrowser.Api.Playback
state.OutputVideoCodec = state.VideoRequest.VideoCodec;
state.OutputVideoBitrate = GetVideoBitrateParamValue(state.VideoRequest, state.VideoStream, state.OutputVideoCodec);
- if (state.OutputVideoBitrate.HasValue)
+ if (videoRequest != null)
+ {
+ TryStreamCopy(state, videoRequest);
+ }
+
+ if (state.OutputVideoBitrate.HasValue && !string.Equals(state.OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
{
var resolution = ResolutionNormalizer.Normalize(
- state.VideoStream == null ? (int?)null : state.VideoStream.BitRate,
+ state.VideoStream == null ? (int?) null : state.VideoStream.BitRate,
state.OutputVideoBitrate.Value,
state.VideoStream == null ? null : state.VideoStream.Codec,
state.OutputVideoCodec,
@@ -1980,13 +1985,12 @@ namespace MediaBrowser.Api.Playback
videoRequest.MaxWidth = resolution.MaxWidth;
videoRequest.MaxHeight = resolution.MaxHeight;
}
- }
- ApplyDeviceProfileSettings(state);
-
- if (videoRequest != null)
+ ApplyDeviceProfileSettings(state);
+ }
+ else
{
- TryStreamCopy(state, videoRequest);
+ ApplyDeviceProfileSettings(state);
}
state.OutputFilePath = GetOutputFilePath(state);
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>