Skip to content

Commit 9c4d85a

Browse files
authored
Merge pull request #26 from dh-sesame/bug/allow-spaces_bufReadInt16BE
fix: bump music-meta version to correct buf.readInt16BE error; allow spaces in file name;
2 parents 6e7ccbc + 1f82716 commit 9c4d85a

File tree

3 files changed

+73
-74
lines changed

3 files changed

+73
-74
lines changed

package-lock.json

Lines changed: 65 additions & 68 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
"karma-mocha-reporter": "2.2.5",
3535
"karma-webpack": "3.0.0",
3636
"mocha": "5.2.0",
37-
"music-metadata": "^6.4.0",
37+
"music-metadata": "^7.9.1",
38+
"shell-quote": "^1.7.2",
3839
"springroll-container": "^1.1.3",
3940
"typescript": "^3.8.3",
4041
"webpack": "4.16.5"
@@ -43,4 +44,4 @@
4344
"@pbs/eslint-config-pbs-kids": "^1.0.2",
4445
"eslint": "^6.8.0"
4546
}
46-
}
47+
}

src/tools/AssetScanner.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const promisify = require('util').promisify;
44
const imageSize = require('image-size');
55
const musicMetadata = require('music-metadata');
66
const { execSync } = require('child_process');
7+
const quote = require('shell-quote').quote;
78

89
const { parseSRASConfig } = require('../lib/srasConfig');
910
const { formatMsToHRT } = require('../lib/format');
@@ -130,10 +131,10 @@ class AssetScanner {
130131

131132
const fileName = filePath.split('\\').pop();
132133

133-
// The command to be passed to ffmpeg.
134-
let ffmpegCommand =
135-
ffmpegPath +
136-
` -i ${filePath} -af loudnorm=I=-16:dual_mono=true:TP=-1.5:LRA=11:print_format=summary` +
134+
// The command to be passed to ffmpeg.
135+
let ffmpegCommand =
136+
ffmpegPath +
137+
` -i ${quote([filePath])} -af loudnorm=I=-16:dual_mono=true:TP=-1.5:LRA=11:print_format=summary` +
137138
` -f null - 2>&1`;
138139

139140

0 commit comments

Comments
 (0)