Skip to content

Commit

Permalink
catch errors for assoc files creation
Browse files Browse the repository at this point in the history
probably fixes MrBrax#127
  • Loading branch information
MrBrax committed Apr 26, 2022
1 parent b065a8b commit 99a43a8
Showing 1 changed file with 26 additions and 7 deletions.
33 changes: 26 additions & 7 deletions server/src/Core/TwitchVOD.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import chalk from "chalk";
import { format, parse, parseISO } from "date-fns";
import { parse, parseISO } from "date-fns";
import fs from "fs";
import { replaceAll } from "../Helpers/ReplaceAll";
import path from "path";
Expand Down Expand Up @@ -641,9 +641,14 @@ export class TwitchVOD {
!fs.existsSync(this.path_vttchapters)
)
) {
this.saveLosslessCut();
this.saveFFMPEGChapters();
this.saveVTTChapters();
try {
this.saveLosslessCut();
this.saveFFMPEGChapters();
this.saveVTTChapters();
} catch (error) {
Log.logAdvanced(LOGLEVEL.ERROR, "vodclass", `Could not save associated files for ${this.basename}: ${(error as Error).message}`);
}

}

}
Expand Down Expand Up @@ -1007,9 +1012,23 @@ export class TwitchVOD {
await this.getMediainfo();

// generate chapter related files
this.saveLosslessCut();
this.saveFFMPEGChapters();
this.saveVTTChapters();
try {
this.saveLosslessCut();
} catch (error) {
Log.logAdvanced(LOGLEVEL.ERROR, "vodclass", `Failed to save lossless cut for ${this.basename}: ${error}`);
}

try {
this.saveFFMPEGChapters();
} catch (error) {
Log.logAdvanced(LOGLEVEL.ERROR, "vodclass", `Failed to save ffmpeg chapters for ${this.basename}: ${error}`);
}

try {
this.saveVTTChapters();
} catch (error) {
Log.logAdvanced(LOGLEVEL.ERROR, "vodclass", `Failed to save vtt chapters for ${this.basename}: ${error}`);
}

// match stored vod to online vod
await this.matchProviderVod();
Expand Down

0 comments on commit 99a43a8

Please sign in to comment.