Skip to content

Commit

Permalink
Update configuration.js
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Tevemadar committed Nov 29, 2024
1 parent bfc86f5 commit c64577a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit c64577a

Please sign in to comment.