From c64577a39ec41165901a3f84bb4aacfcd9724d22 Mon Sep 17 00:00:00 2001 From: Gergely Csucs Date: Fri, 29 Nov 2024 18:37:57 +0100 Subject: [PATCH] Update configuration.js Simple transformation of filenames transform parameter, comma separated list of replacements pairs (what=shouldbe) and fragments to be removed (what, no equals sign). Feature is not tested to hell. --- configuration.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/configuration.js b/configuration.js index d4d237d..3492d9f 100644 --- a/configuration.js +++ b/configuration.js @@ -26,6 +26,16 @@ async function transformSeries(series) { } } + /* + * transform certain parts of filenames (like _thumbnail), comma separated + */ + if (args.transform) { + const parts = args.transform.split(",").map(part => part.split("=")); + for (const slice of series.slices) + for (const part of parts) + slice.filename = slice.filename.replaceAll(part[0], part.length > 1 ? part[1] : ""); + } + if (args.dziproot) { series.dziproot = args.dziproot; }