|
|
@ -14,6 +14,7 @@ using System.Linq;
|
|
|
|
using System.Threading;
|
|
|
|
using System.Threading;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
using CommonIO;
|
|
|
|
using CommonIO;
|
|
|
|
|
|
|
|
using MediaBrowser.Controller.Library;
|
|
|
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Server.Implementations.MediaEncoder
|
|
|
|
namespace MediaBrowser.Server.Implementations.MediaEncoder
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -24,6 +25,7 @@ namespace MediaBrowser.Server.Implementations.MediaEncoder
|
|
|
|
private readonly ILogger _logger;
|
|
|
|
private readonly ILogger _logger;
|
|
|
|
private readonly IMediaEncoder _encoder;
|
|
|
|
private readonly IMediaEncoder _encoder;
|
|
|
|
private readonly IChapterManager _chapterManager;
|
|
|
|
private readonly IChapterManager _chapterManager;
|
|
|
|
|
|
|
|
private readonly ILibraryManager _libraryManager;
|
|
|
|
|
|
|
|
|
|
|
|
public EncodingManager(IFileSystem fileSystem,
|
|
|
|
public EncodingManager(IFileSystem fileSystem,
|
|
|
|
ILogger logger,
|
|
|
|
ILogger logger,
|
|
|
@ -57,6 +59,16 @@ namespace MediaBrowser.Server.Implementations.MediaEncoder
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var libraryOptions = _libraryManager.GetLibraryOptions(video);
|
|
|
|
|
|
|
|
if (libraryOptions != null && libraryOptions.SchemaVersion >= 2)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (!libraryOptions.EnableChapterImageExtraction)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
var options = _chapterManager.GetConfiguration();
|
|
|
|
var options = _chapterManager.GetConfiguration();
|
|
|
|
|
|
|
|
|
|
|
|
if (video is Movie)
|
|
|
|
if (video is Movie)
|
|
|
@ -80,6 +92,7 @@ namespace MediaBrowser.Server.Implementations.MediaEncoder
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Can't extract images if there are no video streams
|
|
|
|
// Can't extract images if there are no video streams
|
|
|
|
return video.DefaultVideoStreamIndex.HasValue;
|
|
|
|
return video.DefaultVideoStreamIndex.HasValue;
|
|
|
|