fixes #321 - Chapter extraction (again)

This commit is contained in:
Luke Pulverenti 2013-06-01 09:56:48 -04:00
parent f82085b21e
commit 6accfc124d

View File

@ -1,5 +1,4 @@
using System.Collections.Generic;
using MediaBrowser.Common.IO;
using MediaBrowser.Common.IO;
using MediaBrowser.Common.MediaInfo;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
@ -164,8 +163,16 @@ namespace MediaBrowser.Controller.MediaInfo
var success = true;
var changesMade = false;
var runtimeTicks = video.RunTimeTicks ?? 0;
foreach (var chapter in video.Chapters)
{
if (chapter.StartPositionTicks >= runtimeTicks)
{
_logger.Info("Stopping chapter extraction for {0} because a chapter was found with a position greater than the runtime.", video.Name);
break;
}
var filename = video.Id + "_" + video.DateModified.Ticks + "_" + chapter.StartPositionTicks;
var path = VideoImageCache.GetResourcePath(filename, ".jpg");