guessit-js 4.3.1 → 4.3.2

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.
@@ -4553,6 +4553,14 @@ function source(config) {
4553
4553
  ...buildSourcePattern(["HD-?CAM"], "", optional(ripSuffix)),
4554
4554
  { value: { source: "HD Camera", other: "Rip" } }
4555
4555
  );
4556
+ rebulk.regex(
4557
+ ...buildSourcePattern(["HQ-?CAM"], "", optional(ripSuffix)),
4558
+ { value: { source: "Camera", other: "Rip" } }
4559
+ );
4560
+ rebulk.regex(
4561
+ ...buildSourcePattern(["S-?Print"], "", optional(ripSuffix)),
4562
+ { value: { source: "Camera" } }
4563
+ );
4556
4564
  rebulk.regex(
4557
4565
  ...buildSourcePattern(["TELESYNC", "TS"], "", optional(ripSuffix)),
4558
4566
  { value: { source: "Telesync", other: "Rip" }, tags: ["video-codec-prefix"], overrides: ["tags"] }
@@ -4601,6 +4609,10 @@ function source(config) {
4601
4609
  ...buildSourcePattern(["DVD"], "", optional(ripSuffix)),
4602
4610
  { value: { source: "DVD", other: "Rip" } }
4603
4611
  );
4612
+ rebulk.regex(
4613
+ ...buildSourcePattern(["DVD-?R[59]"], "", ""),
4614
+ { value: { source: "DVD" } }
4615
+ );
4604
4616
  rebulk.regex(
4605
4617
  ...buildSourcePattern(["LD"], "", ripSuffix),
4606
4618
  { value: { source: "Laserdisc", other: "Rip" } }
@@ -6226,6 +6238,7 @@ const _TitleBaseRule = class _TitleBaseRule extends Rule {
6226
6238
  const lastSeg = createMatch(prevEnd, hole.end);
6227
6239
  if (lastSeg) segments.push(lastSeg);
6228
6240
  if (segments.length < 2) return null;
6241
+ if (/^\d+$/.test(String(segments[0].value ?? "").trim())) return null;
6229
6242
  return { title: segments[0], alternatives: segments.slice(1) };
6230
6243
  }
6231
6244
  /**
@@ -6844,6 +6857,38 @@ const _SplitOriginalScriptTitle = class _SplitOriginalScriptTitle extends Rule {
6844
6857
  };
6845
6858
  _SplitOriginalScriptTitle.priority = POST_PROCESS;
6846
6859
  let SplitOriginalScriptTitle = _SplitOriginalScriptTitle;
6860
+ const _TrimSeasonWordFromTitle = class _TrimSeasonWordFromTitle extends Rule {
6861
+ constructor() {
6862
+ super(...arguments);
6863
+ this.priority = POST_PROCESS;
6864
+ this.consequence = [RemoveMatch, AppendMatch];
6865
+ }
6866
+ when(matches, context) {
6867
+ if (isDisabled(context, "title")) return false;
6868
+ const input = matches.inputString ?? "";
6869
+ const toRemove = [];
6870
+ const toAppend = [];
6871
+ for (const title2 of matches.named("title") ?? []) {
6872
+ const m = /^(.*\S)[\s._-]+(seasons?|saison)$/i.exec(String(title2.value ?? ""));
6873
+ if (!m) continue;
6874
+ const next = matches.range(title2.end, input.length, (mm) => !mm.private && !!mm.value, 0);
6875
+ if (!next || next.name !== "season") continue;
6876
+ toRemove.push(title2);
6877
+ input.slice(title2.start, title2.end).slice(0, m[1].length + (String(title2.value).length === title2.end - title2.start ? 0 : 0));
6878
+ let newEnd = title2.end;
6879
+ while (newEnd > title2.start && cleanup(input.slice(title2.start, newEnd)).toLowerCase() !== m[1].toLowerCase()) newEnd--;
6880
+ if (newEnd <= title2.start) continue;
6881
+ toAppend.push(new Match(title2.start, newEnd, {
6882
+ name: "title",
6883
+ value: cleanup(input.slice(title2.start, newEnd)),
6884
+ inputString: input
6885
+ }));
6886
+ }
6887
+ return toRemove.length || toAppend.length ? [toRemove, toAppend] : false;
6888
+ }
6889
+ };
6890
+ _TrimSeasonWordFromTitle.priority = POST_PROCESS;
6891
+ let TrimSeasonWordFromTitle = _TrimSeasonWordFromTitle;
6847
6892
  const _PreBracketJunkTitle = class _PreBracketJunkTitle extends Rule {
6848
6893
  constructor() {
6849
6894
  super(...arguments);
@@ -7082,7 +7127,7 @@ function title(config) {
7082
7127
  const rebulk = new Rebulk({
7083
7128
  disabled: (context) => isDisabled(context, "title")
7084
7129
  });
7085
- rebulk.rules(CountryAtTitlePosition, TitleWordAtTitlePosition, SplitOriginalScriptTitle, TitleFromPosition, PreferTitleWithYear, ExtendLoneArticleTitle, PropertyAtTitlePositionAsTitle, RemoveNumericAlternativeTitle, RemoveTailAlternativeTitle, RemoveTailTitle, BracketedTitleFallback, PreBracketJunkTitle);
7130
+ rebulk.rules(CountryAtTitlePosition, TitleWordAtTitlePosition, SplitOriginalScriptTitle, TitleFromPosition, PreferTitleWithYear, ExtendLoneArticleTitle, PropertyAtTitlePositionAsTitle, RemoveNumericAlternativeTitle, RemoveTailAlternativeTitle, RemoveTailTitle, BracketedTitleFallback, PreBracketJunkTitle, TrimSeasonWordFromTitle);
7086
7131
  const expectedTitle = buildExpectedFunction("expected_title");
7087
7132
  rebulk.functional(expectedTitle, {
7088
7133
  name: "title",
@@ -12250,7 +12295,10 @@ const advanced_config = {
12250
12295
  },
12251
12296
  "High Resolution": "HR",
12252
12297
  "Line Dubbed": "LD",
12253
- "Mic Dubbed": "MD",
12298
+ "Mic Dubbed": {
12299
+ string: "MD",
12300
+ tags: "title-word"
12301
+ },
12254
12302
  "Micro HD": {
12255
12303
  string: [
12256
12304
  "mHD",