Skip to content

Step 13.1: configurable noise-suffix list in SceneFilenameNormalizer#343

Merged
detain merged 3 commits into
masterfrom
missing/13-noise-suffixes
Jun 29, 2026
Merged

Step 13.1: configurable noise-suffix list in SceneFilenameNormalizer#343
detain merged 3 commits into
masterfrom
missing/13-noise-suffixes

Conversation

@detain

@detain detain commented Jun 29, 2026

Copy link
Copy Markdown
Owner

Step 13.1 — Configurable noise-suffix list in SceneFilenameNormalizer

Adds an ordered (LONGEST-FIRST) NOISE_SUFFIXES const and a pure stripNoiseSuffixes() helper that repeatedly peels any matching TRAILING edition/noise phrase off the parsed title (end-anchored, word-boundary, after optional -._ separators, also tolerating a dangling & left when token-level quality stripping removes one half of a phrase).

Wired in after stripGroupSuffix() / stripBracketedTags() in both:

  • the bracketed-(YYYY) return branch, and
  • the main return path.

Behavior

  • Covers: unrated directors cut, uncut & unrated, alternate ending, extended cut, directors cut, director's cut, theatrical cut, remastered, extended, uncut, yify, dc.
  • Single-token noise is guarded so it never empties a title (DCDC).
  • raw (the original filename for display) is never mutated.

Success conditions (all covered by new tests)

  • Blade Runner Directors CutBlade Runner
  • Aliens 1986 Extended Cut 1080p{title: Aliens, year: 1986}
  • Dune UNCUT & UNRATEDDune
  • District 9 ALTERNATE ENDINGDistrict 9
  • Foo YIFYFoo
  • DCDC
  • raw unchanged

Verification

  • vendor/bin/phpunit --filter SceneFilenameNormalizerOK (69 tests, 170 assertions)
  • vendor/bin/phpstan analyze src/Media/Metadata/SceneFilenameNormalizer.php --level=9 --no-progressNo errors (no baseline)
  • vendor/bin/phpcs --standard=PSR12 -n src/Media/Metadata/SceneFilenameNormalizer.phpclean (exit 0)

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

Add an ordered (longest-first) NOISE_SUFFIXES const and a pure
stripNoiseSuffixes() helper that repeatedly peels trailing edition/noise
phrases (end-anchored, word-boundary, after optional separators) from the
parsed title. Wired in after stripGroupSuffix()/stripBracketedTags() in both
the bracketed-year branch and the main return path. Single-token noise is
guarded so it never empties a title (e.g. "DC" -> "DC"); raw is never mutated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@codacy-production

codacy-production Bot commented Jun 29, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 27 complexity · 0 duplication

Metric Results
Complexity 27
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

detain and others added 2 commits June 29, 2026 17:22
…ping

Adds case-insensitivity (dataProvider), separator variants ( -._), 3x
stacked suffixes, noise after/before a bracketed (YYYY) year, and
mid-string noise-word negative cases (must NOT strip) — all using pure
NOISE_SUFFIX phrases to isolate the Step 13.1 end-anchored peel from the
pre-existing QUALITY_TOKENS token stripping. 87 tests / 200 assertions.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.45455% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 60.22%. Comparing base (0bb5f59) to head (5024942).

Files with missing lines Patch % Lines
src/Media/Metadata/SceneFilenameNormalizer.php 95.45% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #343      +/-   ##
============================================
+ Coverage     60.18%   60.22%   +0.04%     
- Complexity    13155    13161       +6     
============================================
  Files           485      485              
  Lines         42615    42637      +22     
============================================
+ Hits          25647    25678      +31     
+ Misses        16968    16959       -9     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@detain
detain merged commit e4835af into master Jun 29, 2026
17 checks passed
@detain
detain deleted the missing/13-noise-suffixes branch June 29, 2026 22:18
detain added a commit that referenced this pull request Jul 12, 2026
…343)

* Step 13.1: configurable noise-suffix list in SceneFilenameNormalizer

Add an ordered (longest-first) NOISE_SUFFIXES const and a pure
stripNoiseSuffixes() helper that repeatedly peels trailing edition/noise
phrases (end-anchored, word-boundary, after optional separators) from the
parsed title. Wired in after stripGroupSuffix()/stripBracketedTags() in both
the bracketed-year branch and the main return path. Single-token noise is
guarded so it never empties a title (e.g. "DC" -> "DC"); raw is never mutated.


* Step 13.1: add TestEngineer edge-case coverage for noise-suffix stripping

Adds case-insensitivity (dataProvider), separator variants ( -._), 3x
stacked suffixes, noise after/before a bracketed (YYYY) year, and
mid-string noise-word negative cases (must NOT strip) — all using pure
NOISE_SUFFIX phrases to isolate the Step 13.1 end-anchored peel from the
pre-existing QUALITY_TOKENS token stripping. 87 tests / 200 assertions.


---------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant