diff --git a/MediaBrowser.Model/Sync/SyncJob.cs b/MediaBrowser.Model/Sync/SyncJob.cs
index 93e73d22e3..6610ad610d 100644
--- a/MediaBrowser.Model/Sync/SyncJob.cs
+++ b/MediaBrowser.Model/Sync/SyncJob.cs
@@ -24,7 +24,7 @@ namespace MediaBrowser.Model.Sync
/// Gets or sets the quality.
///
/// The quality.
- public SyncQuality Quality { get; set; }
+ public string Quality { get; set; }
///
/// Gets or sets the category.
///
@@ -98,7 +98,6 @@ namespace MediaBrowser.Model.Sync
public SyncJob()
{
RequestedItemIds = new List();
- Quality = SyncQuality.High;
}
}
}
diff --git a/MediaBrowser.Server.Implementations/Sync/SyncJobProcessor.cs b/MediaBrowser.Server.Implementations/Sync/SyncJobProcessor.cs
index b2b43ea982..9be2dd5f0f 100644
--- a/MediaBrowser.Server.Implementations/Sync/SyncJobProcessor.cs
+++ b/MediaBrowser.Server.Implementations/Sync/SyncJobProcessor.cs
@@ -485,6 +485,12 @@ namespace MediaBrowser.Server.Implementations.Sync
}
}
+ private bool IsOriginalQuality(SyncJob job)
+ {
+ return string.IsNullOrWhiteSpace(job.Quality) ||
+ string.Equals(job.Quality, "original", StringComparison.OrdinalIgnoreCase);
+ }
+
private async Task Sync(SyncJobItem jobItem, SyncJob job, Video item, User user, DeviceProfile profile, bool enableConversion, IProgress progress, CancellationToken cancellationToken)
{
var options = _syncManager.GetVideoOptions(jobItem, job);
@@ -504,7 +510,7 @@ namespace MediaBrowser.Server.Implementations.Sync
streamInfo.GetExternalSubtitles(false);
// Mark as requiring conversion if transcoding the video, or if any subtitles need to be extracted
- var requiresVideoTranscoding = streamInfo.PlayMethod == PlayMethod.Transcode && job.Quality != SyncQuality.Original;
+ var requiresVideoTranscoding = streamInfo.PlayMethod == PlayMethod.Transcode && IsOriginalQuality(job);
var requiresConversion = requiresVideoTranscoding || externalSubs.Any(i => RequiresExtraction(i, mediaSource));
if (requiresConversion && !enableConversion)
@@ -692,7 +698,7 @@ namespace MediaBrowser.Server.Implementations.Sync
jobItem.MediaSourceId = streamInfo.MediaSourceId;
jobItem.TemporaryPath = GetTemporaryPath(jobItem);
- if (streamInfo.PlayMethod == PlayMethod.Transcode && job.Quality != SyncQuality.Original)
+ if (streamInfo.PlayMethod == PlayMethod.Transcode && !IsOriginalQuality(job))
{
if (!enableConversion)
{
diff --git a/MediaBrowser.Server.Implementations/Sync/SyncManager.cs b/MediaBrowser.Server.Implementations/Sync/SyncManager.cs
index 3df807e576..3e4d1c1a81 100644
--- a/MediaBrowser.Server.Implementations/Sync/SyncManager.cs
+++ b/MediaBrowser.Server.Implementations/Sync/SyncManager.cs
@@ -150,14 +150,10 @@ namespace MediaBrowser.Server.Implementations.Sync
SyncNewContent = request.SyncNewContent,
ItemCount = items.Count,
Category = request.Category,
- ParentId = request.ParentId
+ ParentId = request.ParentId,
+ Quality = request.Quality
};
- if (!string.IsNullOrWhiteSpace(request.Quality))
- {
- job.Quality = (SyncQuality)Enum.Parse(typeof(SyncQuality), request.Quality, true);
- }
-
if (!request.Category.HasValue && request.ItemIds != null)
{
var requestedItems = request.ItemIds
@@ -565,34 +561,6 @@ namespace MediaBrowser.Server.Implementations.Sync
return item.Name;
}
- public DeviceProfile GetDeviceProfile(string targetId)
- {
- foreach (var provider in _providers)
- {
- foreach (var target in GetSyncTargets(provider))
- {
- if (string.Equals(target.Id, targetId, StringComparison.OrdinalIgnoreCase))
- {
- return GetDeviceProfile(provider, target);
- }
- }
- }
-
- return null;
- }
-
- public DeviceProfile GetDeviceProfile(ISyncProvider provider, SyncTarget target)
- {
- var hasProfile = provider as IHasSyncProfile;
-
- if (hasProfile != null)
- {
- return hasProfile.GetDeviceProfile(target);
- }
-
- return new CloudSyncProfile(true, false);
- }
-
public async Task ReportSyncJobItemTransferred(string id)
{
var jobItem = _repo.GetJobItem(id);
@@ -1021,11 +989,11 @@ namespace MediaBrowser.Server.Implementations.Sync
if (maxBitrate.HasValue)
{
- if (job.Quality == SyncQuality.Medium)
+ if (string.Equals(job.Quality, "high", StringComparison.OrdinalIgnoreCase))
{
maxBitrate = Convert.ToInt32(maxBitrate.Value * .75);
}
- else if (job.Quality == SyncQuality.Low)
+ else if (string.Equals(job.Quality, "medium", StringComparison.OrdinalIgnoreCase))
{
maxBitrate = Convert.ToInt32(maxBitrate.Value * .5);
}
@@ -1037,5 +1005,33 @@ namespace MediaBrowser.Server.Implementations.Sync
MaxBitrate = maxBitrate
};
}
+
+ public DeviceProfile GetDeviceProfile(string targetId)
+ {
+ foreach (var provider in _providers)
+ {
+ foreach (var target in GetSyncTargets(provider))
+ {
+ if (string.Equals(target.Id, targetId, StringComparison.OrdinalIgnoreCase))
+ {
+ return GetDeviceProfile(provider, target);
+ }
+ }
+ }
+
+ return null;
+ }
+
+ public DeviceProfile GetDeviceProfile(ISyncProvider provider, SyncTarget target)
+ {
+ var hasProfile = provider as IHasSyncProfile;
+
+ if (hasProfile != null)
+ {
+ return hasProfile.GetDeviceProfile(target);
+ }
+
+ return new CloudSyncProfile(true, false);
+ }
}
}
diff --git a/MediaBrowser.Server.Implementations/Sync/SyncRepository.cs b/MediaBrowser.Server.Implementations/Sync/SyncRepository.cs
index b0f48e7f54..45b35523a6 100644
--- a/MediaBrowser.Server.Implementations/Sync/SyncRepository.cs
+++ b/MediaBrowser.Server.Implementations/Sync/SyncRepository.cs
@@ -210,7 +210,7 @@ namespace MediaBrowser.Server.Implementations.Sync
if (!reader.IsDBNull(3))
{
- info.Quality = (SyncQuality)Enum.Parse(typeof(SyncQuality), reader.GetString(3), true);
+ info.Quality = reader.GetString(3);
}
if (!reader.IsDBNull(4))