diff options
| author | Luke <luke.pulverenti@gmail.com> | 2015-02-19 12:50:05 -0500 |
|---|---|---|
| committer | Luke <luke.pulverenti@gmail.com> | 2015-02-19 12:50:05 -0500 |
| commit | 8c09665c40776060a09655fb4ea04ec65bdffb73 (patch) | |
| tree | b1432a7315a7a7689be21fa2e3cc122350c778b2 /MediaBrowser.Server.Implementations/Sync/SyncJobProcessor.cs | |
| parent | 3cce8731614e6846096bbe54fca8336e7f5d98d9 (diff) | |
| parent | f2c3dade77878b48a9a333d745e5d92a0f913233 (diff) | |
Merge pull request #1016 from MediaBrowser/dev
3.0.5518.5
Diffstat (limited to 'MediaBrowser.Server.Implementations/Sync/SyncJobProcessor.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Sync/SyncJobProcessor.cs | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/MediaBrowser.Server.Implementations/Sync/SyncJobProcessor.cs b/MediaBrowser.Server.Implementations/Sync/SyncJobProcessor.cs index a254d862c..72dc1bdb6 100644 --- a/MediaBrowser.Server.Implementations/Sync/SyncJobProcessor.cs +++ b/MediaBrowser.Server.Implementations/Sync/SyncJobProcessor.cs @@ -336,11 +336,12 @@ namespace MediaBrowser.Server.Implementations.Sync return new[] { item }; } - public async Task EnsureSyncJobItems(CancellationToken cancellationToken) + private async Task EnsureSyncJobItems(string targetId, CancellationToken cancellationToken) { var jobResult = _syncRepo.GetJobs(new SyncJobQuery { - SyncNewContent = true + SyncNewContent = true, + TargetId = targetId }); foreach (var job in jobResult.Items) @@ -356,7 +357,7 @@ namespace MediaBrowser.Server.Implementations.Sync public async Task Sync(IProgress<double> progress, CancellationToken cancellationToken) { - await EnsureSyncJobItems(cancellationToken).ConfigureAwait(false); + await EnsureSyncJobItems(null, cancellationToken).ConfigureAwait(false); // If it already has a converting status then is must have been aborted during conversion var result = _syncRepo.GetJobItems(new SyncJobItemQuery @@ -375,6 +376,21 @@ namespace MediaBrowser.Server.Implementations.Sync // Clean files in sync temp folder that are not linked to any sync jobs } + public async Task SyncJobItems(string targetId, bool enableConversion, IProgress<double> progress, + CancellationToken cancellationToken) + { + await EnsureSyncJobItems(targetId, cancellationToken).ConfigureAwait(false); + + // If it already has a converting status then is must have been aborted during conversion + var result = _syncRepo.GetJobItems(new SyncJobItemQuery + { + Statuses = new List<SyncJobItemStatus> { SyncJobItemStatus.Queued, SyncJobItemStatus.Converting }, + TargetId = targetId + }); + + await SyncJobItems(result.Items, true, progress, cancellationToken).ConfigureAwait(false); + } + public async Task SyncJobItems(SyncJobItem[] items, bool enableConversion, IProgress<double> progress, CancellationToken cancellationToken) { if (items.Length > 0) @@ -483,7 +499,7 @@ namespace MediaBrowser.Server.Implementations.Sync // No sense creating external subs if we're already burning one into the video var externalSubs = streamInfo.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode ? new List<SubtitleStreamInfo>() : - streamInfo.GetExternalSubtitles("dummy", false); + 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; |
