Skip to content

Commit

Permalink
do not detect code from episode number
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBeastLT committed Oct 28, 2023
1 parent 7bc5645 commit 67ddc99
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ exports.addDefaults = /** @type Parser */ parser => {
parser.addHandler("hdr", /\bHDR(?:10)?\b/i, uniqConcat(value("HDR")), { remove: true, skipIfAlreadyFound: false });

// Codec
parser.addHandler("codec", /[xh][-. ]?26[45]/i, lowercase, { remove: true });
parser.addHandler("codec", /\b[xh][-. ]?26[45]/i, lowercase, { remove: true });
parser.addHandler("codec", /\bhevc(?:\s?10)?\b/i, value("hevc"), { remove: true, skipIfAlreadyFound: false });
parser.addHandler("codec", /\b(?:dvix|mpeg2|divx|xvid|avc)\b/i, lowercase, { remove: true, skipIfAlreadyFound: false });
parser.addHandler("codec", ({ result }) => {
Expand Down
12 changes: 12 additions & 0 deletions test/codec.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,16 @@ describe("Parsing codec", () => {

expect(parse(releaseName)).to.deep.include({ codec: "hevc", bitDepth: "10bit" });
});

it("should not detect 264 codec from episode number", () => {
const releaseName = "[DB]_Bleach_264_[012073FE].avi";

expect(parse(releaseName)).to.not.have.property("codec");
});

it("should not detect 265 codec from episode number", () => {
const releaseName = "[DB]_Bleach_265_[B4A04EC9].avi";

expect(parse(releaseName)).to.not.have.property("codec");
});
});

0 comments on commit 67ddc99

Please sign in to comment.