Compare commits

...

45 Commits

Author SHA1 Message Date
Nemo 4d1bea0d0f run local prettier instead of global one 2023-12-14 15:40:23 +05:30
Nemo a94395ea9d drop node 16 2023-12-14 15:15:41 +05:30
Nemo 8019310674 fix prettier warnings 2023-12-14 15:15:31 +05:30
Nemo 1a2d485d10 dependency updates 2023-12-14 11:34:36 +05:30
dependabot[bot] 7cce1333f1 Bump prettier from 3.0.0 to 3.0.1
Bumps [prettier](https://github.com/prettier/prettier) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.0.0...3.0.1)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-05 09:30:21 +05:30
Nemo 1b9a02fa20 prettier fixes 2023-07-31 15:02:08 +05:30
dependabot[bot] cbc90f7110 Bump prettier from 2.8.8 to 3.0.0
Bumps [prettier](https://github.com/prettier/prettier) from 2.8.8 to 3.0.0.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.8.8...3.0.0)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-31 15:02:08 +05:30
dependabot[bot] b785434c45 Bump ytdl-core from 4.11.4 to 4.11.5
Bumps [ytdl-core](https://github.com/fent/node-ytdl-core) from 4.11.4 to 4.11.5.
- [Release notes](https://github.com/fent/node-ytdl-core/releases)
- [Commits](https://github.com/fent/node-ytdl-core/compare/v4.11.4...v4.11.5)

---
updated-dependencies:
- dependency-name: ytdl-core
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-15 09:35:06 +05:30
dependabot[bot] 7c43700c11 Bump cacheable-request and got
Bumps [cacheable-request](https://github.com/jaredwray/cacheable-request) and [got](https://github.com/sindresorhus/got). These dependencies needed to be updated together.

Updates `cacheable-request` from 7.0.2 to 10.2.7
- [Release notes](https://github.com/jaredwray/cacheable-request/releases)
- [Commits](https://github.com/jaredwray/cacheable-request/commits)

Updates `got` from 12.3.1 to 12.5.3
- [Release notes](https://github.com/sindresorhus/got/releases)
- [Commits](https://github.com/sindresorhus/got/compare/v12.3.1...v12.5.3)

---
updated-dependencies:
- dependency-name: cacheable-request
  dependency-type: indirect
- dependency-name: got
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-05 13:31:07 +05:30
dependabot[bot] 33741a50e7 Bump prettier from 2.8.7 to 2.8.8
Bumps [prettier](https://github.com/prettier/prettier) from 2.8.7 to 2.8.8.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.8.7...2.8.8)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-05 13:30:42 +05:30
dependabot[bot] 3bd269e517 Bump semver from 7.3.7 to 7.5.3
Bumps [semver](https://github.com/npm/node-semver) from 7.3.7 to 7.5.3.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v7.3.7...v7.5.3)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-05 13:30:29 +05:30
dependabot[bot] 2a67cc7c0b Bump ytdl-core from 4.11.3 to 4.11.4
Bumps [ytdl-core](https://github.com/fent/node-ytdl-core) from 4.11.3 to 4.11.4.
- [Release notes](https://github.com/fent/node-ytdl-core/releases)
- [Commits](https://github.com/fent/node-ytdl-core/compare/v4.11.3...v4.11.4)

---
updated-dependencies:
- dependency-name: ytdl-core
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-14 11:17:29 +05:30
dependabot[bot] 51a50b8a11 Bump minimist from 1.2.7 to 1.2.8
Bumps [minimist](https://github.com/minimistjs/minimist) from 1.2.7 to 1.2.8.
- [Release notes](https://github.com/minimistjs/minimist/releases)
- [Changelog](https://github.com/minimistjs/minimist/blob/main/CHANGELOG.md)
- [Commits](https://github.com/minimistjs/minimist/compare/v1.2.7...v1.2.8)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-07 01:02:24 +05:30
dependabot[bot] 7c97cc9bc3 Bump http-cache-semantics from 4.1.0 to 4.1.1
Bumps [http-cache-semantics](https://github.com/kornelski/http-cache-semantics) from 4.1.0 to 4.1.1.
- [Release notes](https://github.com/kornelski/http-cache-semantics/releases)
- [Commits](https://github.com/kornelski/http-cache-semantics/compare/v4.1.0...v4.1.1)

---
updated-dependencies:
- dependency-name: http-cache-semantics
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-07 01:02:17 +05:30
dependabot[bot] ce3c11a820 Bump prettier from 2.8.2 to 2.8.7
Bumps [prettier](https://github.com/prettier/prettier) from 2.8.2 to 2.8.7.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.8.2...2.8.7)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-07 01:02:11 +05:30
dependabot[bot] d376b3ad3d Bump ytdl-core from 4.11.2 to 4.11.3
Bumps [ytdl-core](https://github.com/fent/node-ytdl-core) from 4.11.2 to 4.11.3.
- [Release notes](https://github.com/fent/node-ytdl-core/releases)
- [Commits](https://github.com/fent/node-ytdl-core/compare/v4.11.2...v4.11.3)

---
updated-dependencies:
- dependency-name: ytdl-core
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-07 01:01:46 +05:30
dependabot[bot] 6af3c1da60 Bump prettier from 2.8.1 to 2.8.2
Bumps [prettier](https://github.com/prettier/prettier) from 2.8.1 to 2.8.2.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.8.1...2.8.2)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-10 06:34:07 +00:00
dependabot[bot] 68bf09689a Bump prettier from 2.8.0 to 2.8.1
Bumps [prettier](https://github.com/prettier/prettier) from 2.8.0 to 2.8.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.8.0...2.8.1)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-13 11:41:46 +05:30
dependabot[bot] 84c23243d3 Bump mocha from 10.1.0 to 10.2.0
Bumps [mocha](https://github.com/mochajs/mocha) from 10.1.0 to 10.2.0.
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v10.1.0...v10.2.0)

---
updated-dependencies:
- dependency-name: mocha
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-13 11:39:33 +05:30
dependabot[bot] 1e9bace48d Bump prettier from 2.7.1 to 2.8.0
Bumps [prettier](https://github.com/prettier/prettier) from 2.7.1 to 2.8.0.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.7.1...2.8.0)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-24 11:02:23 +05:30
dependabot[bot] 00af711bf6 Bump minimist from 1.2.6 to 1.2.7
Bumps [minimist](https://github.com/minimistjs/minimist) from 1.2.6 to 1.2.7.
- [Release notes](https://github.com/minimistjs/minimist/releases)
- [Changelog](https://github.com/minimistjs/minimist/blob/main/CHANGELOG.md)
- [Commits](https://github.com/minimistjs/minimist/compare/v1.2.6...v1.2.7)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-15 17:37:05 +05:30
dependabot[bot] 278aebf32f Bump mocha from 10.0.0 to 10.1.0
Bumps [mocha](https://github.com/mochajs/mocha) from 10.0.0 to 10.1.0.
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v10.0.0...v10.1.0)

---
updated-dependencies:
- dependency-name: mocha
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-18 15:02:27 +05:30
dependabot[bot] 1743561886 Bump ytdl-core from 4.11.1 to 4.11.2
Bumps [ytdl-core](https://github.com/fent/node-ytdl-core) from 4.11.1 to 4.11.2.
- [Release notes](https://github.com/fent/node-ytdl-core/releases)
- [Commits](https://github.com/fent/node-ytdl-core/compare/v4.11.1...v4.11.2)

---
updated-dependencies:
- dependency-name: ytdl-core
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-07 15:08:21 +05:30
Nemo f4f0e4db76 1.0.10 2022-08-26 18:36:36 +05:30
Nemo 8a570f74ad Prettier fixes 2022-08-26 18:36:33 +05:30
Nemo 5ba24e95db Fixes #75
Drops any tracks that start after the track length (as per YouTube).
We can add a flag for making this optional in case it is needed
2022-08-26 18:33:06 +05:30
Nemo 91242ce61f [ci] Dropped support for Node v16 2022-08-26 17:58:15 +05:30
Nemo 34acfe769e [style] Fix lint issues 2022-08-26 17:55:45 +05:30
Nemo 0012c3b083 [fix] Fixes #74
Leading zeroes are nice
2022-08-26 17:51:19 +05:30
Nemo 93321c6fb9 [docs] Update CHANGELOG 2022-08-26 17:22:07 +05:30
Nemo 25e0081c6d 1.0.9 2022-08-26 17:22:07 +05:30
Nemo 9245d84332 [dep] dependency updates 2022-08-26 17:22:05 +05:30
Nemo bb11d6e9a8
Create FUNDING.yml 2022-05-27 07:18:57 +00:00
Nemo ce4074f829 [ci] Use supported Node versions 2022-05-03 13:02:33 +05:30
dependabot[bot] 25ff38e93e Bump mocha from 9.2.2 to 10.0.0
Bumps [mocha](https://github.com/mochajs/mocha) from 9.2.2 to 10.0.0.
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v9.2.2...v10.0.0)

---
updated-dependencies:
- dependency-name: mocha
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-03 13:02:33 +05:30
dependabot[bot] 343fbda261 Bump prettier from 2.6.1 to 2.6.2
Bumps [prettier](https://github.com/prettier/prettier) from 2.6.1 to 2.6.2.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.6.1...2.6.2)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-22 12:15:15 +05:30
dependabot[bot] f53aed7dec Bump minimist from 1.2.5 to 1.2.6
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-22 12:14:45 +05:30
dependabot[bot] 531ad3de3f Bump prettier from 2.6.0 to 2.6.1
Bumps [prettier](https://github.com/prettier/prettier) from 2.6.0 to 2.6.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.6.0...2.6.1)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-26 09:43:40 +05:30
dependabot[bot] c185212b14 Bump prettier from 2.5.1 to 2.6.0
Bumps [prettier](https://github.com/prettier/prettier) from 2.5.1 to 2.6.0.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.5.1...2.6.0)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-21 11:09:14 +05:30
dependabot[bot] 869487e153 Bump mocha from 9.2.1 to 9.2.2
Bumps [mocha](https://github.com/mochajs/mocha) from 9.2.1 to 9.2.2.
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v9.2.1...v9.2.2)

---
updated-dependencies:
- dependency-name: mocha
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-12 10:52:58 +05:30
Nemo 98f17e55d3 [docs] CHANGELOG update 2022-03-11 11:27:52 +05:30
Nemo f281a42a2e 1.0.8 2022-03-11 11:26:30 +05:30
Nemo 242e08bc1b [deps] Update 2022-03-11 11:26:27 +05:30
dependabot[bot] e83debe2bf Bump ytdl-core from 4.10.1 to 4.11.0
Bumps [ytdl-core](https://github.com/fent/node-ytdl-core) from 4.10.1 to 4.11.0.
- [Release notes](https://github.com/fent/node-ytdl-core/releases)
- [Commits](https://github.com/fent/node-ytdl-core/compare/v4.10.1...v4.11.0)

---
updated-dependencies:
- dependency-name: ytdl-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-08 12:15:11 +05:30
dependabot[bot] 9925d6e578 Bump ytdl-core from 4.10.0 to 4.10.1
Bumps [ytdl-core](https://github.com/fent/node-ytdl-core) from 4.10.0 to 4.10.1.
- [Release notes](https://github.com/fent/node-ytdl-core/releases)
- [Commits](https://github.com/fent/node-ytdl-core/compare/v4.10.0...v4.10.1)

---
updated-dependencies:
- dependency-name: ytdl-core
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-04 17:10:09 +05:30
11 changed files with 836 additions and 1723 deletions

3
.github/FUNDING.yml vendored Normal file
View File

@ -0,0 +1,3 @@
github: captn3m0
ko_fi: captn3m0
liberapay: captn3m0

View File

@ -4,7 +4,7 @@ jobs:
tests:
strategy:
matrix:
node: ["16", "14", "12"]
node: ["18", "20", "21"]
name: Run NPM Stuff
runs-on: ubuntu-latest
steps:

View File

@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased
## 1.0.9
### Changed
- Dependency Updates
- Minimum NodeJS version is now v14
## 1.0.8
### Added
- Dependency Updates
## 1.0.7
### Added
- `--version` is now supported
- An update notification is shown if the package isn't latest.

View File

@ -52,14 +52,12 @@ You need to pass 2 parameters, a Youtube URL and a output CUE filename. YouTube
very specific edge cases, they should not be required for most files.
Examples
$ youtube-cue --audio-file audio.m4a "https://www.youtube.com/watch?v=THzUassmQwE"
"T A Y L O R S W I F T Folklore [Full album].cue" saved
$ youtube-cue "https://youtu.be/THzUassmQwE" folklore.cue
folklore.cue saved
$ youtube-cue --audio-file audio.m4a "https://www.youtube.com/watch?v=WzpmVxvoBoc" "The Groovy Nobody - Solarium.cue"
"The Groovy Nobody - Solarium.cue" saved
## Personal Usage
I have this in my `.bashrc` to download, split, tag, and import albums:
I have this in my `.bashrc` to download, split, tag, and import albums using beet:
```shell
function ytdl.album() {

View File

@ -74,6 +74,7 @@ if (argv.version) {
artist,
forceTimestamps,
forceDurations,
length: Number(info.videoDetails.lengthSeconds),
});
generate({ tracks, artist, audioFile, album }, output_file);
console.log(`"${output_file}" saved`);

2435
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "youtube-cue",
"version": "1.0.7",
"version": "1.0.10",
"description": "Generates Cue sheet from Youtube URL",
"main": "index.js",
"scripts": {
@ -11,15 +11,15 @@
"author": "Nemo <npm@captnemo.in>",
"license": "MIT",
"devDependencies": {
"mocha": "^9.2.0",
"prettier": "^2.3.2"
"mocha": "^10.0.0",
"prettier": "^3.1.0"
},
"dependencies": {
"console-log-level": "^1.4.1",
"get-artist-title": "^1.3.1",
"minimist": "^1.2.5",
"update-notifier": "^5.1.0",
"ytdl-core": "^4.8.2"
"minimist": "^1.2.8",
"update-notifier": "^7.0.0",
"ytdl-core": "^4.11.5"
},
"repository": {
"type": "git",

View File

@ -1,5 +1,10 @@
import fs from "fs";
/** code to create a new CUE file, as per the standard
* with a REM PERFORMER, TITLE, FILE attribute
* and a list of tracks provided as input
*/
// https://en.wikipedia.org/wiki/Cue_sheet_(computing)
export function generate(data, outputFile) {
try {
@ -11,14 +16,12 @@ export function generate(data, outputFile) {
fs.appendFileSync(outputFile, `FILE "${data.audioFile}" M4A\n`);
for (var i in data.tracks) {
let song = data.tracks[i];
let minutes = song.start.hh * 60 + song.start.mm;
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`);
// Cue File is always MINUTES:SECONDS:FRAME, where FRAME is 00
fs.appendFileSync(
outputFile,
` INDEX 01 ${minutes}:${song.start.ss}:00\n`
);
fs.appendFileSync(outputFile, ` INDEX 01 ${minutes}:${seconds}:00\n`);
}
}

View File

@ -41,8 +41,8 @@ var firstPass = function (line) {
let track = matches.groups["trackl"]
? +matches.groups["trackl"]
: matches.groups["trackr"]
? +matches.groups["trackr"]
: null;
? +matches.groups["trackr"]
: null;
return {
track: track,
start: {
@ -153,9 +153,19 @@ var fixDurations = function (list) {
}
};
var dropInvalid = function (e) {
// All tracks should start before the closing time
if (_options.length) return e.start.calc < _options.length;
return true;
};
export function parse(
text,
options = { artist: "Unknown", forceTimestamps: false, forceDurations: false }
options = {
artist: "Unknown",
forceTimestamps: false,
forceDurations: false,
},
) {
_options = options;
let durations = false;
@ -184,5 +194,10 @@ export function parse(
}
}
return result.map(parseTitle).map(parseArtist).map(addTrack).map(addEnd);
return result
.map(parseTitle)
.map(parseArtist)
.map(addTrack)
.map(addEnd)
.filter(dropInvalid);
}

48
test/cue_test.js Normal file
View File

@ -0,0 +1,48 @@
/*jshint esversion: 6 */
import { strict as assert } from "assert";
import { generate } from "../src/cue.js";
import fs from "fs";
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" },
},
],
};
describe("CUE", function () {
it("should generate with leading zeroes", function () {
generate(DATA, "/tmp/test.cue");
const CUE_EXPECTED = `REM Generated using youtube-cue
PERFORMER "Dumbledore"
TITLE "Curse of the Elder Wand"
FILE "audio.m4a" M4A
TRACK 1 AUDIO
TITLE "the 1"
PERFORMER "Unknown"
INDEX 01 00:00:00
TRACK 2 AUDIO
TITLE "cardigan"
PERFORMER "Unknown"
INDEX 01 03:09:00
`;
assert.equal(CUE_EXPECTED, fs.readFileSync("/tmp/test.cue", "utf-8"));
});
});

View File

@ -152,7 +152,7 @@ describe("Parser", function () {
let result = parse(
`1. Artist - Title 5:00
2. Another Artist - Another Title 4:20`,
{ forceTimestamps: true }
{ forceTimestamps: true },
);
assert.deepEqual(result[0].end, {
ts: "00:4:20",
@ -174,7 +174,7 @@ describe("Parser", function () {
let result = parse(
`1. Artist - Title 1:00
2. Another Artist - Another Title 1:15`,
{ forceDurations: true }
{ forceDurations: true },
);
assert.deepEqual(result[0], {
track: 1,