Skip to content

Commit

Permalink
add spanish subs case handling
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBeastLT committed Oct 14, 2023
1 parent 9f0cbb1 commit ea6ec93
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ exports.addDefaults = /** @type Parser */ parser => {
parser.addHandler("languages", /\bes(?=[ .,/-]+(?:[A-Z]{2}[ .,/-]+){2,})\b/i, uniqConcat(value("spanish")), { skipFromTitle: true, skipIfAlreadyFound: false });
parser.addHandler("languages", /\b(?<=[ .,/-]+(?:[A-Z]{2}[ .,/-]+){2,})es\b/i, uniqConcat(value("spanish")), { skipFromTitle: true, skipIfAlreadyFound: false });
parser.addHandler("languages", /\b(?<=[ .,/-]+[A-Z]{2}[ .,/-]+)es(?=[ .,/-]+[A-Z]{2}[ .,/-]+)\b/i, uniqConcat(value("spanish")), { skipFromTitle: true, skipIfAlreadyFound: false });
parser.addHandler("languages", /\bspanish\W+subs?\b/i, uniqConcat(value("spanish")), { skipIfAlreadyFound: false });
parser.addHandler("languages", /\b(spanish|espanhol)\b/i, uniqConcat(value("spanish")), { skipIfFirst: true, skipIfAlreadyFound: false });
parser.addHandler("languages", /\b(?:p[rt]|en|port)[. (\\/-]*BR\b/i, uniqConcat(value("portuguese")), { skipIfAlreadyFound: false, remove: true });
parser.addHandler("languages", /\b(?:leg(?:endado|endas?)?|dub(?:lado)?|portugu[eèê]se?)[. -]*BR\b/i, uniqConcat(value("portuguese")), { skipIfAlreadyFound: false });
Expand Down
6 changes: 6 additions & 0 deletions test/language.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,12 @@ describe("Parsing language", () => {
expect(parse(releaseName)).to.deep.include({ languages: ["spanish"] });
});

it("10_Spanish-Subs.srt", () => {
const releaseName = "10_Spanish-Subs.srt";

expect(parse(releaseName)).to.deep.include({ languages: ["spanish"] });
});

it("Patriot Games [1992] Eng, Ger, Cze, Hun, Pol + multisub DVDrip", () => {
const releaseName = "Patriot Games [1992] Eng, Ger, Cze, Hun, Pol + multisub DVDrip";

Expand Down

0 comments on commit ea6ec93

Please sign in to comment.