don't try to extract images if a video doesn't have any known video streams

This commit is contained in:
LukePulverenti 2013-03-13 21:24:43 -04:00
parent f9dd970bf8
commit 00e0e44398
2 changed files with 15 additions and 2 deletions

View File

@ -51,7 +51,7 @@ namespace MediaBrowser.Controller.MediaInfo
/// The _logger
/// </summary>
private readonly Kernel _kernel;
/// <summary>
/// The _logger
/// </summary>
@ -591,6 +591,12 @@ namespace MediaBrowser.Controller.MediaInfo
throw new ArgumentNullException();
}
// Can't extract images if there are no video streams
if (video.MediaStreams == null || video.MediaStreams.All(m => m.Type != MediaStreamType.Video))
{
return;
}
var changesMade = false;
foreach (var chapter in video.Chapters)

View File

@ -1,4 +1,5 @@
using MediaBrowser.Common.IO;
using System.Linq;
using MediaBrowser.Common.IO;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Model.Entities;
@ -47,6 +48,12 @@ namespace MediaBrowser.Controller.Providers.MediaInfo
if (video != null)
{
// Can't extract images if there are no video streams
if (video.MediaStreams == null || video.MediaStreams.All(m => m.Type != MediaStreamType.Video))
{
return false;
}
if (video.VideoType == VideoType.Iso && video.IsoType.HasValue && _isoManager.CanMount(item.Path))
{
return true;