From 1bc3539e0d7c6686655ede649e6be8da53e4c217 Mon Sep 17 00:00:00 2001 From: TheBeastLT Date: Thu, 2 Jan 2025 18:42:38 +0200 Subject: [PATCH] add more 3d handlers --- src/handlers.js | 6 +++++- test/threeD.js | 25 +++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/handlers.js b/src/handlers.js index 7f0a18a..c8cd2d0 100644 --- a/src/handlers.js +++ b/src/handlers.js @@ -110,10 +110,14 @@ exports.addDefaults = /** @type Parser */ parser => { // 3D parser.addHandler("threeD", /\b(3D)\b.*\b(Half-?SBS|H[-\\/]?SBS)\b/i, value("3D HSBS")); + parser.addHandler("threeD", /\bHalf.Side.?By.?Side\b/i, value("3D HSBS")); parser.addHandler("threeD", /\b(3D)\b.*\b(Full-?SBS|SBS)\b/i, value("3D SBS")); + parser.addHandler("threeD", /\bSide.?By.?Side\b/i, value("3D SBS")); parser.addHandler("threeD", /\b(3D)\b.*\b(Half-?OU|H[-\\/]?OU)\b/i, value("3D HOU")); + parser.addHandler("threeD", /\bHalf.?Over.?Under\b/i, value("3D HOU")); parser.addHandler("threeD", /\b(3D)\b.*\b(OU)\b/i, value("3D OU")); - parser.addHandler("threeD", /\b(3D)\b/i, value("3D"), { skipIfFirst: true }); + parser.addHandler("threeD", /\bOver.?Under\b/i, value("3D OU")); + parser.addHandler("threeD", /\b((?:BD)?3D)\b/i, value("3D"), { skipIfFirst: true }); // Codec parser.addHandler("codec", /\b[xh][-. ]?26[45]/i, lowercase, { remove: true }); diff --git a/test/threeD.js b/test/threeD.js index 14a7ec0..0192e17 100644 --- a/test/threeD.js +++ b/test/threeD.js @@ -107,6 +107,31 @@ describe("Parsing 3D", () => { expect(parse(releaseName)).to.deep.include({ threeD: "3D" }); }); + it("should detect HD3D", () => { + const releaseName = "Бамблби / Bumblebee [2018, BDRemux, 1080p] BD3D"; + expect(parse(releaseName)).to.deep.include({ threeD: "3D" }); + }); + + it("should detect SideBySide", () => { + const releaseName = "Дэдпул и Росомаха / Deadpool & Wolverine [2024, BDRip, 1080p] SideBySide"; + expect(parse(releaseName)).to.deep.include({ threeD: "3D SBS" }); + }); + + it("should detect Half SideBySide", () => { + const releaseName = "Вий / Forbidden Kingdom [2014, WEB-DL] Half SideBySide"; + expect(parse(releaseName)).to.deep.include({ threeD: "3D HSBS" }); + }); + + it("should detect OverUnder", () => { + const releaseName = "Дэдпул и Росомаха / Deadpool & Wolverine [2024, BDRip, 1080p] OverUnder"; + expect(parse(releaseName)).to.deep.include({ threeD: "3D OU" }); + }); + + it("should detect Half OverUnder", () => { + const releaseName = "Миссия «Луна» / Лунный / Mooned [2023, BDRip] Half OverUnder"; + expect(parse(releaseName)).to.deep.include({ threeD: "3D HOU" }); + }); + it("should not detect 3D in name", () => { const releaseName = "Texas.Chainsaw.3D.2013.PROPER.1080p.BluRay.x264-LiViDiTY"; expect(parse(releaseName)).to.not.have.property("threeD");