Code Monkey home page Code Monkey logo

cue-parser's People

Contributors

aaron-em avatar bludwarf avatar borewit avatar dependabot-preview[bot] avatar dependabot[bot] avatar er1z avatar justlaputa avatar mathieu-lavigne avatar n0namedguy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cue-parser's Issues

Support parsing a string

Nice library!
Would be nice if we could also parse a string from memory (not just a file)
That way this library could also be used in the browser/web and React Native (not tied to Node.js).

The result for all my cue files contain only one track due to this code.

The sequence adds the second file to the array right after adding the first track at this point:

if (_number === 1 && time.min === 0 && time.min === 0 && time.sec === 0 && time.frame === 0) {

Then, all remaining tracks add to this second file.
After all, the second file is removed at this point:
if (!cuesheet.files[cuesheet.files.length - 1].name) {

Cue sheet won't be opened if chardet detects ISO-8859-9 (instead of ISO-8859-1)

Good night.

I have a cue sheet that chardet somehow determines it is encoded in ISO-8859-9. The cue file has no special characters whatsoever.

Because chardet detects ISO-8859-9 the check made at

switch (cuesheet.encoding) {
does not set the encoding to binary, therefore passing it straight to fs.readFileSync (at
const lines = (fs.readFileSync(filename, {encoding, flag: 'r'}) as any)
), which in turn makes NodeJS crap itself, because it doesn't know how to handle this encoding.

Cheers,
David S.

parseTime with more than 2-digits-hours

The parseTime function in cue.js is not able to parse time code when hours is greather than 99.

Though I know cuesheet file format is not intended to support it, would you please replace :

var timePattern = /^(\d{2}):(\d{2}):(\d{2})$/,

by

var timePattern = /^(\d{2,}):(\d{2}):(\d{2})$/,

This would allow any length for hour digits.

Thank you for your work 👍

Unable to parse strange characters

When parsing .cue with non-english characters like è, a characters with a question mark is displayed.
I attach a problematc .cue for reference:

REM GENRE Pop REM DATE 1992 REM DISCID EE0E0910 REM COMMENT "ExactAudioCopy v0.99pb4" CATALOG 4509901590208 PERFORMER "Nomadi" TITLE "Ma Noi No!" FILE "Nomadi - Ma Noi No!.flac" WAVE TRACK 01 AUDIO TITLE "Come potete giudicar" PERFORMER "Nomadi" INDEX 01 00:00:00 TRACK 02 AUDIO TITLE "Noi non ci saremo" PERFORMER "Nomadi" INDEX 00 03:21:57 INDEX 01 03:23:62 TRACK 03 AUDIO TITLE "Dio � morto" PERFORMER "Nomadi" INDEX 00 06:16:00 INDEX 01 06:17:57 TRACK 04 AUDIO TITLE "Per fare un uomo" PERFORMER "Nomadi" INDEX 00 09:10:10 INDEX 01 09:11:62 TRACK 05 AUDIO TITLE "Ho difeso il mio amore" PERFORMER "Nomadi" INDEX 00 12:12:15 INDEX 01 12:13:60 TRACK 06 AUDIO TITLE "Canzone per un'amica" PERFORMER "Nomadi" INDEX 00 16:25:35 INDEX 01 16:27:42 TRACK 07 AUDIO TITLE "Io vagabondo" PERFORMER "Nomadi" INDEX 00 19:45:37 INDEX 01 19:47:22 TRACK 08 AUDIO TITLE "Crescerai" PERFORMER "Nomadi" INDEX 00 23:39:37 INDEX 01 23:41:20 TRACK 09 AUDIO TITLE "Un giorno insieme" PERFORMER "Nomadi" INDEX 00 27:15:55 INDEX 01 27:17:35 TRACK 10 AUDIO TITLE "Tutto a posto" PERFORMER "Nomadi" INDEX 00 30:40:22 INDEX 01 30:42:22 INDEX 01 30:42:22 TRACK 11 AUDIO TITLE "Il vecchio e il bambino" PERFORMER "Nomadi" INDEX 00 34:22:17 INDEX 01 34:23:72 TRACK 12 AUDIO TITLE "Gordon" PERFORMER "Nomadi" INDEX 00 40:00:22 INDEX 01 40:02:05 TRACK 13 AUDIO TITLE "Il pilota di Hiroshima" PERFORMER "Nomadi" INDEX 00 44:28:62 INDEX 01 44:30:40 TRACK 14 AUDIO TITLE "Ma noi no!" PERFORMER "Nomadi" INDEX 00 47:44:17 INDEX 01 47:45:57 TRACK 15 AUDIO TITLE "I ragazzi dell'olivo" PERFORMER "Nomadi" INDEX 00 52:31:40 INDEX 01 52:33:00 TRACK 16 AUDIO TITLE "Gli aironi neri" PERFORMER "Nomadi" INDEX 00 55:14:22 INDEX 01 55:15:65

I can't read such characters even from cmdline. Is there a solution for this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.