playlist-admin 2.6.80 → 2.6.81

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -32,11 +32,16 @@ export async function convert({ inputPath, outputPath, format = 'mp3', ffmpegPat
32
32
 
33
33
  try {
34
34
  const result = await run(ffmpeg, args, { timeout: 600000 });
35
- if (result.code !== 0) return { ok: false, lufs: null };
35
+ if (result.code !== 0) {
36
+ // Remove the partial/empty output so the file isn't treated as done.
37
+ try { fs.unlinkSync(outputPath); } catch {}
38
+ return { ok: false, lufs: null };
39
+ }
36
40
  const m = result.stderr.match(/Input Integrated:\s+([-\d.]+)/);
37
41
  const lufs = m ? parseFloat(m[1]) : null;
38
42
  return { ok: true, lufs };
39
43
  } catch {
44
+ try { fs.unlinkSync(outputPath); } catch {}
40
45
  return { ok: false, lufs: null };
41
46
  }
42
47
  }
@@ -106,7 +106,8 @@ export class PipelineOrchestrator {
106
106
 
107
107
  const mp3Name = `${stemOf(m4a)}.mp3`;
108
108
  const dest = path.join(config.mp3Path, mp3Name);
109
- if (fs.existsSync(dest) && fs.statSync(dest).mtimeMs >= fs.statSync(m4a).mtimeMs) {
109
+ if (fs.existsSync(dest) && fs.statSync(dest).size > 0 &&
110
+ fs.statSync(dest).mtimeMs >= fs.statSync(m4a).mtimeMs) {
110
111
  skipped++;
111
112
  scanned++;
112
113
  this._scanLog(scanned, totalM4a, tasks, skipped);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "playlist-admin",
3
- "version": "2.6.80",
3
+ "version": "2.6.81",
4
4
  "description": "Playlist Administrator CLI - music library pipeline, podcast pipeline and Spotube automation (Node.js)",
5
5
  "type": "module",
6
6
  "bin": {