Skip to content

Commit

Permalink
Fix broken nfo generation due to missed API change when switching xml…
Browse files Browse the repository at this point in the history
… builder libs - fixes #216

Also makes the workflow a bit more robust so that less confusing retry messages are logged and artwork is downloaded even if nfo creation fails
  • Loading branch information
tobias-theobald authored and Inrixia committed Oct 27, 2024
1 parent f00abe6 commit 983696b
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/lib/Video.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,23 @@ export class Video extends Attachment {
logger.log("Download complete!");
if (settings.extras.saveNfo) {
logger.log("Saving .nfo");
await this.saveNfo();
try {
await this.saveNfo();
} catch (error) {
// non-critical error
const message = this.parseErrorMessage(error);
logger.error(`Failed to save .nfo file! ${message} - Skipping`);
}
}
if (settings.extras.downloadArtwork) {
logger.log("Saving artwork");
await this.downloadArtwork();
try {
await this.downloadArtwork();
} catch (error) {
// non-critical error
const message = this.parseErrorMessage(error);
logger.error(`Failed to save artwork! ${message} - Skipping`);
}
}
}
// eslint-disable-next-line no-fallthrough
Expand Down Expand Up @@ -227,7 +239,8 @@ export class Video extends Attachment {
episode = match[2];
}
const nfo = builder
.create("episodedetails")
.create()
.ele("episodedetails")
.ele("title")
.txt(this.videoTitle)
.up()
Expand Down

0 comments on commit 983696b

Please sign in to comment.