podcast-dl 11.7.4 → 11.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/naming.js CHANGED
@@ -44,10 +44,12 @@ export const getSafeName = (name, maxLength = MAX_LENGTH_FILENAME) => {
44
44
  // after the last period while truncating from the START, which destroys
45
45
  // dates and other important prefix content in podcast titles.
46
46
  const sanitized = name.replace(/\./g, INVALID_CHAR_REPLACE);
47
+ // filenamify v6 normalizes to NFD internally. filenamify v7 switches back
48
+ // to NFC, but requires a newer Node baseline, so mirror that fix here.
47
49
  return filenamify(sanitized, {
48
50
  replacement: INVALID_CHAR_REPLACE,
49
51
  maxLength,
50
- });
52
+ }).normalize("NFC");
51
53
  };
52
54
 
53
55
  export const getSimpleFilename = (name, ext = "") => {
@@ -32,6 +32,12 @@ describe("getSafeName", () => {
32
32
 
33
33
  expect(getSafeName("2024.01.02.Episode.mp3")).toBe("2024_01_02_Episode_mp3");
34
34
  });
35
+
36
+ it("keeps accented characters in composed Unicode form", async () => {
37
+ const { getSafeName } = await loadNaming();
38
+
39
+ expect(getSafeName("á é í ó ö ú ü")).toBe("á é í ó ö ú ü");
40
+ });
35
41
  });
36
42
 
37
43
  describe("getSimpleFilename", () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "podcast-dl",
3
- "version": "11.7.4",
3
+ "version": "11.7.5",
4
4
  "description": "A CLI for downloading podcasts.",
5
5
  "type": "module",
6
6
  "bin": "./bin/bin.js",