Skip to content

Commit

Permalink
Merge pull request #190 from zorin1/fix-cue-index
Browse files Browse the repository at this point in the history
Fixed Cue sheet possiton to be in MM:SS:FF
  • Loading branch information
bookbonobo authored Apr 18, 2024
2 parents 3a53beb + c26ffb2 commit 7aac771
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/processor/mp3-with-cue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export async function processMP3Files(spine: Spine, meta: MP3Meta, decode: boole
processed.cueContent += `
TRACK ${zeroPad(idx + 1)} AUDIO
TITLE "${entry.title}"
INDEX 01 ${toTime(false, Math.round(start))}`;
INDEX 01 ${toTime(false, Math.round(start))}:00`;
await updateTask(chapterTask, "Completed");
}

Expand Down Expand Up @@ -186,4 +186,4 @@ function toTime(withHours: boolean, seconds: number): string {
const s = Math.floor(seconds % 3600 % 60);
return `${zeroPad(m)}:${zeroPad(s)}`;
}
}
}
10 changes: 5 additions & 5 deletions tests/mp3withcue.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,15 @@ describe("chapter processing", () => {
FILE "Book Title.mp3" MP3
TRACK 01 AUDIO
TITLE "Chapter 1"
INDEX 01 00:00
INDEX 01 00:00:00
TRACK 02 AUDIO
TITLE "Chapter 2"
INDEX 01 02:30
INDEX 01 02:30:00
TRACK 03 AUDIO
TITLE "Chapter 3"
INDEX 01 02:55
INDEX 01 02:55:00
TRACK 04 AUDIO
TITLE "Chapter 4"
INDEX 01 04:10`);
INDEX 01 04:10:00`);
});
});
});

0 comments on commit 7aac771

Please sign in to comment.