Skip to content
This repository was archived by the owner on Jun 14, 2026. It is now read-only.

refactor(aither): AKA formatting - #1376

Open
wastaken7 wants to merge 2 commits into
masterfrom
refactor/aither-torrent-name-handling
Open

refactor(aither): AKA formatting#1376
wastaken7 wants to merge 2 commits into
masterfrom
refactor/aither-torrent-name-handling

Conversation

@wastaken7

@wastaken7 wastaken7 commented May 23, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Bug Fixes
    • More accurate year handling for tracker entry names across TV, manual overrides, and no-year scenarios.
    • Correctly injects computed year into foreign-language suffixes for specific source types.
    • Improved alternative-title support with adjusted formatting so titles and years appear in the intended order.

Review Change Stack

@github-actions

Copy link
Copy Markdown

Thanks for taking the time to contribute to this project. Upload Assistant is currently in a complete rewrite, and no new development is being conducted on this python source at this time.

If you have come this far, please feel free to leave open, any pull requests regarding new sites being added to the source, as these can serve as the baseline for later conversion.

If your pull request relates to a critical bug, this will be addressed in this code base, and a new release published as needed.

If your pull request only addresses a quite minor bug, it is not likely to be addressed in this code base.

Details for the new code base will follow at a later date.

@coderabbitai

coderabbitai Bot commented May 23, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

AITHER.get_name now derives a computed year (honoring no_year, TV search_year, and manual_year) and uses it for REMUX+DVD foreign-language suffixes; it also extracts alt_title from metadata and reorders the first "{year} {alt_title}" substring to "{alt_title} {year}" before returning the final name.

Changes

AITHER Tracker Naming Enhancements

Layer / File(s) Summary
Year computation for foreign-language releases
src/trackers/AITHER.py
Computes a derived year (respecting no_year, using TV search_year, and applying manual_year when > 0) and injects this computed year into the REMUX+DVD foreign-language suffix instead of meta['year'].
Alternative title incorporation and reordering
src/trackers/AITHER.py
Extracts alt_title from meta['aka'] unless no_aka is set, inserts it into the assembled name, and replaces the first {year} {alt_title} occurrence with {alt_title} {year}.

Estimated Code Review Effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 AITHER hops through metadata bright,
computing years and setting right—
alt titles twirl before the year,
names now tidy, crisp, and clear,
a rabbit's nudge makes strings delight.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'refactor(aither): AKA formatting' accurately reflects the main change: introducing AKA (alternative title) handling in the AITHER tracker's naming logic, including alt_title derivation from meta['aka'] and year-alt_title reordering.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/aither-torrent-name-handling

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/trackers/AITHER.py`:
- Line 68: The assignment to year in the AITHER tracker is inconsistent: change
the branch that sets year = meta["year"] when meta["search_year"] != "" to
convert the value to a string (e.g., year = str(meta["year"])) so year is always
a string like the other branch; update the assignment in the block that
references meta["search_year"] and ensure subsequent string operations in the
same function (the code around lines using year on lines ~79 and ~98) will
receive a consistent str type.
- Line 79: The code calls aither_name.replace(year, f"{year} {foreign_lang}", 1)
without guarding for an empty year, which causes unwanted insertion when year ==
""; update the logic around the aither_name replacement to first check that year
is truthy/non-empty (and optionally that no_year is False) before performing
aither_name.replace(...), so skip the replacement entirely when year is empty;
refer to the variables aither_name, year, foreign_lang and any no_year flag in
the surrounding function in AITHER.py to locate and fix the code.
- Around line 66-71: The year computation in src/trackers/AITHER.py currently
applies the no_year flag first but then overwrites it with TV-specific logic and
manual_year; update the logic so that meta["no_year"] takes final precedence
(mirror upstream get_name.py behavior): compute year from meta["year"], TV
branch (meta["category"] == "TV" and meta["search_year"] != ""), and
manual_year_value as now, but after those steps check meta.get("no_year", False)
and if True set year = "" (or otherwise ensure no_year cannot be overridden);
reference the variables/year assignment and the branches handling
meta["category"] == "TV", manual_year_value, and meta["no_year"] to locate where
to reorder the checks.
🪄 Autofix (Beta)

✅ Autofix completed


ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5c323379-142f-4f53-8a1c-ea06d322d55f

📥 Commits

Reviewing files that changed from the base of the PR and between 3e39d5d and d86a8bf.

📒 Files selected for processing (1)
  • src/trackers/AITHER.py

Comment thread src/trackers/AITHER.py Outdated
Comment thread src/trackers/AITHER.py Outdated
Comment thread src/trackers/AITHER.py Outdated
@coderabbitai

coderabbitai Bot commented May 23, 2026

Copy link
Copy Markdown

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

Fixes Applied Successfully

Fixed 1 file(s) based on 3 unresolved review comments.

Files modified:

  • src/trackers/AITHER.py

Commit: b0e21801810fd46de24bd47fec6c05c63e13d404

The changes have been pushed to the refactor/aither-torrent-name-handling branch.

Time taken: 2m 59s

Fixed 1 file(s) based on 3 unresolved review comments.

Co-authored-by: CodeRabbit <noreply@coderabbit.ai>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/trackers/AITHER.py (1)

100-101: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Guard against empty year in alt_title reordering.

When year is empty (e.g., when no_year=True after line 73), the replace pattern becomes f" {alt_title}" (space + alt_title). This could incorrectly match and reorder a space-prefixed alt_title elsewhere in the name, even though no year is present. This is analogous to the issue fixed on line 81.

🛡️ Proposed fix to skip reordering when year is empty
-        if alt_title:
+        if alt_title and year:
             aither_name = aither_name.replace(f"{year} {alt_title}", f"{alt_title} {year}", 1)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/trackers/AITHER.py` around lines 100 - 101, The current alt_title reorder
uses a replace with f"{year} {alt_title}" which will misfire when year is empty;
update the block that mutates aither_name (the if alt_title: branch) to skip the
replace unless year is non-empty (or !no_year) so you only call
aither_name.replace(f"{year} {alt_title}", ...) when year is truthy; reference
the variables aither_name, alt_title and year (and the existing no_year flag) to
locate and gate the operation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@src/trackers/AITHER.py`:
- Around line 100-101: The current alt_title reorder uses a replace with
f"{year} {alt_title}" which will misfire when year is empty; update the block
that mutates aither_name (the if alt_title: branch) to skip the replace unless
year is non-empty (or !no_year) so you only call aither_name.replace(f"{year}
{alt_title}", ...) when year is truthy; reference the variables aither_name,
alt_title and year (and the existing no_year flag) to locate and gate the
operation.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 97eab090-32f4-4cac-bb26-5f23e4e4efea

📥 Commits

Reviewing files that changed from the base of the PR and between d86a8bf and b0e2180.

📒 Files selected for processing (1)
  • src/trackers/AITHER.py

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant