Skip to content

Commit abb9ca5

Browse files
committed
fix: skip problematic ffmpeg metadata on Windows
closes #109
1 parent 43591c7 commit abb9ca5

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

bin/ffmpeg.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import dayjs from "dayjs";
22
import fs from "fs";
33
import { execWithPromise } from "./exec.js";
44
import { LOG_LEVELS, logMessage } from "./logger.js";
5-
import { escapeArgForShell } from "./util.js";
5+
import { escapeArgForShell, isWin } from "./util.js";
66

77
export const runFfmpeg = async ({
88
feed,
@@ -52,14 +52,18 @@ export const runFfmpeg = async ({
5252
artist,
5353
album_artist: artist,
5454
title,
55-
subtitle,
56-
comment,
5755
disc,
5856
track,
5957
"episode-type": episodeType,
6058
date,
6159
};
6260

61+
if (!isWin) {
62+
// Due to limited escape options, these metadata fields often break in Windows
63+
metaKeysToValues.comment = comment;
64+
metaKeysToValues.subtitle = subtitle
65+
}
66+
6367
const metadataString = Object.keys(metaKeysToValues)
6468
.map((key) => {
6569
if (!metaKeysToValues[key]) {

bin/util.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import path from "path";
33
import rssParser from "rss-parser";
44
import { logErrorAndExit, logMessage } from "./logger.js";
55

6-
const isWin = process.platform === "win32";
6+
export const isWin = process.platform === "win32";
77

88
export const defaultRssParserConfig = {
99
defaultRSS: 2.0,

0 commit comments

Comments
 (0)