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

pull/702/head
LukePulverenti 12 years ago
parent f9dd970bf8
commit 00e0e44398

@ -591,6 +591,12 @@ namespace MediaBrowser.Controller.MediaInfo
throw new ArgumentNullException(); 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; var changesMade = false;
foreach (var chapter in video.Chapters) foreach (var chapter in video.Chapters)

@ -1,4 +1,5 @@
using MediaBrowser.Common.IO; using System.Linq;
using MediaBrowser.Common.IO;
using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities;
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;
@ -47,6 +48,12 @@ namespace MediaBrowser.Controller.Providers.MediaInfo
if (video != null) 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)) if (video.VideoType == VideoType.Iso && video.IsoType.HasValue && _isoManager.CanMount(item.Path))
{ {
return true; return true;

Loading…
Cancel
Save