Skip to content

Commit

Permalink
add more 3d handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBeastLT committed Jan 2, 2025
1 parent b98e2ba commit 1bc3539
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down
25 changes: 25 additions & 0 deletions test/threeD.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 1bc3539

Please sign in to comment.