@andrewstart/av-encoder
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -47,3 +47,3 @@ "use strict"; | ||
const id = path.basename(file, path.extname(file)); | ||
const override = (_a = group.overrides) === null || _a === void 0 ? void 0 : _a[id]; | ||
const override = (_a = group.overrides) === null || _a === void 0 ? void 0 : _a[file]; | ||
const currentSettings = Object.assign({}, defaults, group, override); | ||
@@ -53,3 +53,3 @@ delete currentSettings.src; | ||
delete currentSettings.overrides; | ||
const oldSettings = cache.getSettings(id) || currentSettings; | ||
const oldSettings = cache.getSettings(file) || currentSettings; | ||
const changed = { opus: false, mp3: false, caf: false }; | ||
@@ -56,0 +56,0 @@ if (currentSettings.mono != oldSettings.mono) { |
@@ -50,3 +50,3 @@ "use strict"; | ||
const id = path.basename(file, path.extname(file)); | ||
const override = (_a = group.overrides) === null || _a === void 0 ? void 0 : _a[id]; | ||
const override = (_a = group.overrides) === null || _a === void 0 ? void 0 : _a[file]; | ||
const currentSettings = Object.assign({}, defaults, group, override); | ||
@@ -57,3 +57,3 @@ delete currentSettings.src; | ||
delete currentSettings.audioOut; | ||
const oldSettings = cache.getSettings(id) || currentSettings; | ||
const oldSettings = cache.getSettings(file) || currentSettings; | ||
let changed = false; | ||
@@ -69,4 +69,2 @@ if (currentSettings.quality != oldSettings.quality || currentSettings.width != oldSettings.width) { | ||
const target = targetBase + '.mp4'; | ||
const targetCaf = targetBase + '.caf'; | ||
const targetMp3 = targetBase + '.mp3'; | ||
if (!await fs.pathExists(target)) { | ||
@@ -73,0 +71,0 @@ changed = true; |
@@ -34,8 +34,7 @@ "use strict"; | ||
const hash = await hasha.fromFile(absPath, { algorithm: 'md5' }); | ||
const filename = path.basename(filePath, path.extname(filePath)); | ||
// if not present in cache, return true (add to hashes) | ||
// if present, remove from unseen, compare hash with hasha, and update hashes if changed | ||
let changed = true; | ||
if (this.hashes.has(filename)) { | ||
const data = this.hashes.get(filename); | ||
if (this.hashes.has(filePath)) { | ||
const data = this.hashes.get(filePath); | ||
if (data.hash == hash) { | ||
@@ -46,5 +45,5 @@ changed = false; | ||
if (changed) { | ||
this.hashes.set(filename, { hash, settings }); | ||
this.hashes.set(filePath, { hash, settings }); | ||
} | ||
this.unseen.delete(filename); | ||
this.unseen.delete(filePath); | ||
return changed; | ||
@@ -51,0 +50,0 @@ } |
{ | ||
"name": "@andrewstart/av-encoder", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Encodes and compresses audio/video for widely supported web formats", | ||
@@ -5,0 +5,0 @@ "bin": { |
@@ -47,3 +47,3 @@ # av-encoder | ||
overrides: { | ||
'intro': { | ||
'src/vo/intro.wav': { | ||
opusTargetBitrate: '48k', | ||
@@ -50,0 +50,0 @@ mp3Quality: '7' |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19102
340