diff options
| author | Luke <luke.pulverenti@gmail.com> | 2017-08-13 16:21:10 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-08-13 16:21:10 -0400 |
| commit | dc578f3742b474bd85d556299a6b2763f4d9acda (patch) | |
| tree | cc4a8d1de140ece77160349e51a64857656ab373 /Emby.Server.Implementations/MediaEncoder/EncodingManager.cs | |
| parent | f6ed934a7e32bf10c3a141773d713bf3b19e784f (diff) | |
| parent | 7f200f057d33e3ef52b1b1b1bf1767577295317e (diff) | |
Merge pull request #2815 from MediaBrowser/beta
Beta
Diffstat (limited to 'Emby.Server.Implementations/MediaEncoder/EncodingManager.cs')
| -rw-r--r-- | Emby.Server.Implementations/MediaEncoder/EncodingManager.cs | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/Emby.Server.Implementations/MediaEncoder/EncodingManager.cs b/Emby.Server.Implementations/MediaEncoder/EncodingManager.cs index 1d74e8788..7ee6e9e38 100644 --- a/Emby.Server.Implementations/MediaEncoder/EncodingManager.cs +++ b/Emby.Server.Implementations/MediaEncoder/EncodingManager.cs @@ -29,9 +29,9 @@ namespace Emby.Server.Implementations.MediaEncoder private readonly IChapterManager _chapterManager; private readonly ILibraryManager _libraryManager; - public EncodingManager(IFileSystem fileSystem, - ILogger logger, - IMediaEncoder encoder, + public EncodingManager(IFileSystem fileSystem, + ILogger logger, + IMediaEncoder encoder, IChapterManager chapterManager, ILibraryManager libraryManager) { _fileSystem = fileSystem; @@ -45,7 +45,7 @@ namespace Emby.Server.Implementations.MediaEncoder /// Gets the chapter images data path. /// </summary> /// <value>The chapter images data path.</value> - private string GetChapterImagesPath(IHasImages item) + private string GetChapterImagesPath(IHasMetadata item) { return Path.Combine(item.GetInternalMetadataPath(), "chapters"); } @@ -84,13 +84,8 @@ namespace Emby.Server.Implementations.MediaEncoder /// </summary> private static readonly long FirstChapterTicks = TimeSpan.FromSeconds(15).Ticks; - public async Task<bool> RefreshChapterImages(ChapterImageRefreshOptions options, CancellationToken cancellationToken) + public async Task<bool> RefreshChapterImages(Video video, List<ChapterInfo> chapters, bool extractImages, bool saveChapters, CancellationToken cancellationToken) { - var extractImages = options.ExtractImages; - var video = options.Video; - var chapters = options.Chapters; - var saveChapters = options.SaveChapters; - if (!IsEligibleForChapterImageExtraction(video)) { extractImages = false; @@ -117,16 +112,14 @@ namespace Emby.Server.Implementations.MediaEncoder { if (extractImages) { - if (video.VideoType == VideoType.HdDvd || video.VideoType == VideoType.Iso) + if (video.VideoType == VideoType.Iso) { continue; } + if (video.VideoType == VideoType.BluRay || video.VideoType == VideoType.Dvd) { - if (video.PlayableStreamFileNames.Count != 1) - { - continue; - } + continue; } try @@ -136,13 +129,13 @@ namespace Emby.Server.Implementations.MediaEncoder var protocol = MediaProtocol.File; - var inputPath = MediaEncoderHelpers.GetInputArgument(_fileSystem, video.Path, protocol, null, video.PlayableStreamFileNames); + var inputPath = MediaEncoderHelpers.GetInputArgument(_fileSystem, video.Path, protocol, null, new List<string>()); _fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(path)); var container = video.Container; - var tempFile = await _encoder.ExtractVideoImage(inputPath, container, protocol, video.Video3DFormat, time, cancellationToken).ConfigureAwait(false); + var tempFile = await _encoder.ExtractVideoImage(inputPath, container, protocol, video.GetDefaultVideoStream(), video.Video3DFormat, time, cancellationToken).ConfigureAwait(false); _fileSystem.CopyFile(tempFile, path, true); try @@ -151,7 +144,7 @@ namespace Emby.Server.Implementations.MediaEncoder } catch { - + } chapter.ImagePath = path; @@ -181,7 +174,7 @@ namespace Emby.Server.Implementations.MediaEncoder if (saveChapters && changesMade) { - await _chapterManager.SaveChapters(video.Id.ToString(), chapters, cancellationToken).ConfigureAwait(false); + await _chapterManager.SaveChapters(video.Id.ToString(), chapters).ConfigureAwait(false); } DeleteDeadImages(currentImages, chapters); |
