Skip to content

Commit

Permalink
Fixed autosplit seconds logic
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas committed Apr 21, 2018
1 parent 1a2d3f2 commit 1c06b97
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/library/M4bTool/Command/MergeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -370,11 +370,12 @@ private function buildChaptersFromConvertedFileDurations()
}
$chapterIndex = 1;
while ($start < $this->totalDuration->milliseconds()) {
$chapterTitle = $indexedTitle;
if($autoSplitMilliSeconds > 0 && $autoSplitMilliSeconds < $duration->milliseconds()) {
$indexedTitle .= " (".($chapterIndex++).")";
$chapterTitle = $indexedTitle." - (".($chapterIndex++).")";
}

$this->chapters[$start] = new Chapter(new TimeUnit($start), new TimeUnit($duration->milliseconds()), $indexedTitle);
$this->chapters[$start] = new Chapter(new TimeUnit($start), new TimeUnit($duration->milliseconds()), $chapterTitle);

if($autoSplitMilliSeconds <= 0 || $autoSplitMilliSeconds > $duration->milliseconds()) {
break;
Expand Down

0 comments on commit 1c06b97

Please # to comment.