diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-03-12 00:03:45 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-03-12 00:03:45 -0400 |
| commit | cf6c46c6a69b1b80a8d6b0059c143d0dacd2b3c8 (patch) | |
| tree | b507812ad926953eb1f9930b89678273a586bd99 /MediaBrowser.Server.Implementations/Sync/SyncJobProcessor.cs | |
| parent | 8f90e54faf0b71a17ee2ae54d05418c29256a84e (diff) | |
change sync job quality to a string
Diffstat (limited to 'MediaBrowser.Server.Implementations/Sync/SyncJobProcessor.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Sync/SyncJobProcessor.cs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/MediaBrowser.Server.Implementations/Sync/SyncJobProcessor.cs b/MediaBrowser.Server.Implementations/Sync/SyncJobProcessor.cs index b2b43ea98..9be2dd5f0 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<double> 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) { |
