🏡 index : github.com/captn3m0/youtube-cue.git

author Nemo <commits@captnemo.in> 2022-08-26 18:36:33.0 +05:30:00
committer Nemo <commits@captnemo.in> 2022-08-26 18:36:33.0 +05:30:00
commit
8a570f74ad13f26fec8240a4abcdabd77662c240 [patch]
tree
224a621f89191cf4c636ec1b54809980c5e66cb6
parent
5ba24e95db29fe6f55a9832f9efcbaf94b9f5c92
download
8a570f74ad13f26fec8240a4abcdabd77662c240.tar.gz

Prettier fixes



Diff

 index.js      |  2 +-
 src/parser.js | 13 ++++++++++---
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/index.js b/index.js
index e94fe72..7d9eb02 100755
--- a/index.js
+++ a/index.js
@@ -74,7 +74,7 @@
      artist,
      forceTimestamps,
      forceDurations,
      length: Number(info.videoDetails.lengthSeconds)
      length: Number(info.videoDetails.lengthSeconds),
    });
    generate({ tracks, artist, audioFile, album }, output_file);
    console.log(`"${output_file}" saved`);
diff --git a/src/parser.js b/src/parser.js
index ea0d421..17c67ba 100644
--- a/src/parser.js
+++ a/src/parser.js
@@ -153,11 +153,11 @@
  }
};

var dropInvalid = function(e) {
var dropInvalid = function (e) {
  // All tracks should start before the closing time
  if (_options.length) return (e.start.calc < _options.length);
  if (_options.length) return e.start.calc < _options.length;
  return true;
}
};

export function parse(
  text,
@@ -190,5 +190,10 @@
    }
  }

  return result.map(parseTitle).map(parseArtist).map(addTrack).map(addEnd).filter(dropInvalid);
  return result
    .map(parseTitle)
    .map(parseArtist)
    .map(addTrack)
    .map(addEnd)
    .filter(dropInvalid);
}