[style] Fix lint issues
Diff
index.js | 2 +-
src/cue.js | 9 +++------
test/cue_test.js | 38 +++++++++++++++++++++++++-------------
3 files changed, 24 insertions(+), 25 deletions(-)
@@ -49,7 +49,7 @@
let url = argv._[0];
ytdl.getInfo(url).then((info) => {
console.log(info)
console.log(info);
let audioFile = argv["audio-file"]
? argv["audio-file"]
: `${info.videoDetails.title}.m4a`;
@@ -11,15 +11,12 @@
fs.appendFileSync(outputFile, `FILE "${data.audioFile}" M4A\n`);
for (var i in data.tracks) {
let song = data.tracks[i];
let minutes = String(song.start.hh * 60 + song.start.mm).padStart(2, '0');
let seconds = String(song.start.ss).padStart(2, '0');
let minutes = String(song.start.hh * 60 + song.start.mm).padStart(2, "0");
let seconds = String(song.start.ss).padStart(2, "0");
fs.appendFileSync(outputFile, ` TRACK ${song.track} AUDIO\n`);
fs.appendFileSync(outputFile, ` TITLE "${song.title}"\n`);
fs.appendFileSync(outputFile, ` PERFORMER "${song.artist}"\n`);
fs.appendFileSync(
outputFile,
` INDEX 01 ${minutes}:${seconds}:00\n`
);
fs.appendFileSync(outputFile, ` INDEX 01 ${minutes}:${seconds}:00\n`);
}
}
@@ -6,23 +6,25 @@
const DATA = {
artist: "Dumbledore",
album: "Curse of the Elder Wand",
audioFile: 'audio.m4a',
tracks: [{
artist: "Unknown",
title: "the 1",
track: 1,
start: { ts: "00:00:00", hh: 0, mm: 0, ss: 0, calc: 0 },
end: { ts: "00:3:9", hh: 0, mm: 3, ss: 9, calc: 189 },
_: { left_text: "", right_text: "the 1" },
},
{
artist: "Unknown",
title: "cardigan",
track: 2,
start: { ts: "00:3:09", hh: 0, mm: 3, ss: 9, calc: 189 },
end: { ts: "00:9:30", hh: 0, mm: 9, ss: 30, calc: 570 },
_: { left_text: "", right_text: "cardigan" },
}]
audioFile: "audio.m4a",
tracks: [
{
artist: "Unknown",
title: "the 1",
track: 1,
start: { ts: "00:00:00", hh: 0, mm: 0, ss: 0, calc: 0 },
end: { ts: "00:3:9", hh: 0, mm: 3, ss: 9, calc: 189 },
_: { left_text: "", right_text: "the 1" },
},
{
artist: "Unknown",
title: "cardigan",
track: 2,
start: { ts: "00:3:09", hh: 0, mm: 3, ss: 9, calc: 189 },
end: { ts: "00:9:30", hh: 0, mm: 9, ss: 30, calc: 570 },
_: { left_text: "", right_text: "cardigan" },
},
],
};
describe("CUE", function () {
@@ -41,6 +43,6 @@
PERFORMER "Unknown"
INDEX 01 03:09:00
`;
assert.equal(CUE_EXPECTED, fs.readFileSync('/tmp/test.cue', 'utf-8'));
assert.equal(CUE_EXPECTED, fs.readFileSync("/tmp/test.cue", "utf-8"));
});
});