-
Notifications
You must be signed in to change notification settings - Fork 118
adding foreign lang support for TVC and some minor improvements #986
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
WalkthroughAdded date and description formatting helpers and a public flag on TVC; refactored category lookup with a foreign-language override (42→43); replaced direct dict accesses with Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant U as Uploader
participant TVC as TVC.upload()
participant Helpers as TVC.Helpers
participant API as Tracker/API
U->>TVC: upload(meta, disctype, image_list)
TVC->>Helpers: format_date_ddmmyyyy(meta.get("episode_airdate"))
TVC->>Helpers: format_description(meta.get("overview") or meta.get("text"))
TVC->>TVC: get_cat_id(meta.get("genres")) or force cat_id=43 (lang check)
TVC->>TVC: build tvc_name (uses formatted date if available)
TVC->>TVC: tvc_edit_desc(meta, tracker, signature, image_list)
TVC->>API: submit upload payload
API-->>TVC: response
TVC-->>U: return result
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/trackers/TVC.py (1)
162-162: Consider renaming the parameter for consistency.The call passes
image_listbut the method signature at Line 404 names the parameterscreens. While functionally correct, consistent naming would improve readability.Consider updating the method signature at Line 404:
- async def unit3d_edit_desc(self, meta, tracker, signature, screens, comparison=False): + async def unit3d_edit_desc(self, meta, tracker, signature, image_list, comparison=False):And update the assignment at Line 466:
- images = screens + images = image_list
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/trackers/TVC.py(9 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/trackers/TVC.py (1)
src/trackers/COMMON.py (1)
unit3d_edit_desc(131-773)
🔇 Additional comments (8)
src/trackers/TVC.py (8)
9-10: LGTM! Clean additions.The new imports and class attribute are correctly added and used throughout the file.
Also applies to: 20-21
34-38: LGTM! Robust date formatting.The method handles parsing errors gracefully by returning the original string, which is appropriate defensive coding.
42-54: LGTM! Category mapping refactored correctly.The conversion to local variables is cleaner, and the foreign language category ID update aligns with the PR objectives.
203-204: LGTM! Date formatting applied correctly.The formatted date is used safely within the conditional block that checks for
episode_airdateexistence.
397-402: LGTM! Clean text wrapping implementation.The method correctly wraps descriptions at 100 characters to align with site formatting standards.
442-446: LGTM! Safer dictionary access and date formatting.The use of
.get()with appropriate defaults improves robustness, and the date formatting is correctly applied.
451-456: LGTM! Robust text formatting with safe dictionary access.Excellent use of
.get()with appropriate defaults combined with the new text wrapping method.
459-459: LGTM! Minor formatting cleanup.These whitespace and formatting adjustments have no functional impact and improve consistency.
Also applies to: 469-469, 493-493
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (1)
src/trackers/TVC.py (1)
152-156: Use safer dictionary access fororiginal_language.Direct access to
meta["original_language"]at Line 152 could raise aKeyErrorif the key doesn't exist.Apply this diff to use safer dictionary access:
- if meta["original_language"] != "en": + if meta.get("original_language") != "en": # setting category as foreign if original language is not english cat_id = 43 else:Note: If
original_languageis missing,get()returnsNone, which would not equal"en", so the content would be categorized as foreign. If this isn't the desired behavior, consider usingmeta.get("original_language", "en")to default to English when the key is missing.
🧹 Nitpick comments (2)
src/trackers/TVC.py (2)
160-160: Prefer.get()over ternary for dict access.The pattern
meta['tv_pack'] if 'tv_pack' in meta else 0is functional but unidiomatic.- resolution_id = await self.get_res_id(meta['tv_pack'] if 'tv_pack' in meta else 0, meta['resolution']) + resolution_id = await self.get_res_id(meta.get('tv_pack', 0), meta['resolution'])
397-402: Add defensiveNonecheck informat_description.While current callers (Lines 453, 456) provide empty string defaults,
format_descriptionshould handleNonedefensively to prevent potentialAttributeErrorfromtextwrap.wrap().def format_description(self, description): + if description is None: + return "" # adding line breaks around the 100 char limit to be line with the default format of the site wrapped_lines = textwrap.wrap(description, width=100)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/trackers/TVC.py(9 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-11-04T18:14:11.336Z
Learnt from: tdrkmn
Repo: Audionut/Upload-Assistant PR: 980
File: src/trackers/SHRI.py:1057-1075
Timestamp: 2025-11-04T18:14:11.336Z
Learning: In src/trackers/SHRI.py, the BBCode description generated by get_description() intentionally wraps the entire output in [code]...[/code] tags to achieve an "old-school style" where BBCode tags render as literal text rather than being parsed. This is a design preference, not a bug.
Applied to files:
src/trackers/TVC.py
🔇 Additional comments (6)
src/trackers/TVC.py (6)
9-10: LGTM!The new imports for
textwrapanddatetimeare appropriate for the description formatting and date conversion functionality added in this PR.
20-21: LGTM!The
is_other_apiclass attribute appropriately identifies this tracker's API type.
42-54: LGTM!Good refactor converting
tv_typesandtv_types_idsfrom instance to local variables since they're only used within this method. The foreign language category ID update from 42 to 43 is consistent with the assignment at Line 154.
162-162: LGTM!The change from
unit3d_edit_desctotvc_edit_descaligns with TVC-specific description formatting requirements.
442-456: LGTM!Excellent use of safer dictionary access with
.get()methods fortv_packandnetworks, and proper integration of the new formatting helpers. The code handles missing keys gracefully with appropriate defaults.
459-459: LGTM!Minor formatting cleanups for consistency.
Also applies to: 469-469, 493-493
| def format_date_ddmmyyyy(self, date_str): | ||
| try: | ||
| return datetime.strptime(date_str, "%Y-%m-%d").strftime("%d-%m-%Y") | ||
| except (ValueError, TypeError): | ||
| return date_str |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Handle None dates explicitly to avoid "None" appearing in titles.
When date_str is None (which can occur when TMDB returns no air date at Line 321), this method returns None, causing f-strings at Lines 204 and 446 to render the string "None" in release titles like "Show (2024) S01E01 (None) [1080p]".
Consider returning an empty string or a placeholder for None dates:
def format_date_ddmmyyyy(self, date_str):
+ if date_str is None:
+ return "TBA" # or "" to omit entirely
try:
return datetime.strptime(date_str, "%Y-%m-%d").strftime("%d-%m-%Y")
except (ValueError, TypeError):
return date_str📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| def format_date_ddmmyyyy(self, date_str): | |
| try: | |
| return datetime.strptime(date_str, "%Y-%m-%d").strftime("%d-%m-%Y") | |
| except (ValueError, TypeError): | |
| return date_str | |
| def format_date_ddmmyyyy(self, date_str): | |
| if date_str is None: | |
| return "TBA" # or "" to omit entirely | |
| try: | |
| return datetime.strptime(date_str, "%Y-%m-%d").strftime("%d-%m-%Y") | |
| except (ValueError, TypeError): | |
| return date_str |
🤖 Prompt for AI Agents
In src/trackers/TVC.py around lines 34 to 38, the date formatter returns None
when date_str is None which leads to the literal "None" showing up in formatted
titles; update the function to explicitly handle None (e.g., if date_str is
None: return "") before attempting to parse, and otherwise keep the existing
try/except to handle invalid formats and types so invalid dates still fall back
to the original input.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
src/trackers/TVC.py (2)
332-333: Fix dict-to-string conversion error in fallback dates.Both lines use
str({meta["year"]})which creates a string representation of a dict literal (e.g.,"{'year': 2024}"), not the year value itself. This results in malformed date strings like"{'year': 2024}-N/A-N/A".Apply this diff to fix the conversion:
- meta['season_air_first_date'] = str({meta["year"]}) + "-N/A-N/A" - meta['first_air_date'] = str({meta["year"]}) + "-N/A-N/A" + meta['season_air_first_date'] = f"{meta['year']}-N/A-N/A" + meta['first_air_date'] = f"{meta['year']}-N/A-N/A"
438-438: Use consistent and safe dictionary access fortv_pack.Direct access to
meta['tv_pack']could raise aKeyErrorif the key is missing. Line 442 correctly usesmeta.get('tv_pack'), but Line 438 (here) and Line 451 use direct dictionary access. For consistency and safety, all three should use.get().Apply this diff:
- elif meta['category'] == "TV" and meta['tv_pack'] == 1 and 'first_air_date' in meta: + elif meta['category'] == "TV" and meta.get('tv_pack') == 1 and 'first_air_date' in meta:
♻️ Duplicate comments (1)
src/trackers/TVC.py (1)
34-38: HandleNonedates explicitly to avoid "None" appearing in titles.This issue was previously raised. When
date_strisNone, this method returnsNone, causing f-strings at Lines 203-204 and 446 to render the literal string"None"in titles and descriptions.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/trackers/TVC.py(9 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-11-04T18:14:11.336Z
Learnt from: tdrkmn
Repo: Audionut/Upload-Assistant PR: 980
File: src/trackers/SHRI.py:1057-1075
Timestamp: 2025-11-04T18:14:11.336Z
Learning: In src/trackers/SHRI.py, the BBCode description generated by get_description() intentionally wraps the entire output in [code]...[/code] tags to achieve an "old-school style" where BBCode tags render as literal text rather than being parsed. This is a design preference, not a bug.
Applied to files:
src/trackers/TVC.py
🧬 Code graph analysis (1)
src/trackers/TVC.py (2)
src/trackers/SPD.py (1)
get_cat_id(34-74)src/trackers/MTV.py (1)
get_cat_id(328-344)
🔇 Additional comments (2)
src/trackers/TVC.py (2)
42-54: LGTM: Category mapping logic is clear.The local
tv_typesandtv_types_idsarrays are well-structured, and the index-based lookup with a default to the "holding bin" category (index 14) provides a safe fallback.
397-402: LGTM: Text wrapping implementation is clean.The use of
textwrap.wrap()with a 100-character width and joining with newlines is a straightforward and correct approach for formatting long descriptions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
♻️ Duplicate comments (1)
src/trackers/TVC.py (1)
34-38: HandleNonedates explicitly to avoid "None" in formatted output.When
date_strisNone(which can occur when TMDB returns no air date), thetry/exceptcatches theTypeErrorand returnsNone. This causes f-strings at lines 204 and 446 to render the literal string"None"in titles and descriptions.Apply this diff to handle
Noneexplicitly:def format_date_ddmmyyyy(self, date_str): + if date_str is None: + return "" # or "TBA" if you prefer a placeholder try: return datetime.strptime(date_str, "%Y-%m-%d").strftime("%d-%m-%Y") except (ValueError, TypeError): return date_str
🧹 Nitpick comments (2)
src/trackers/TVC.py (2)
152-156: Consider defaulting to English whenoriginal_languageis missing.When
meta.get("original_language")returnsNone(key missing), the comparison!= "en"evaluates toTrue, categorizing the content as foreign. This may not be the intended behavior for content with unknown language.If you want missing language data to default to English (non-foreign), apply this diff:
- if meta.get("original_language") != "en": + if meta.get("original_language", "en") != "en": # setting category as foreign if original language is not english cat_id = 43 else: cat_id = await self.get_cat_id(meta['genres'])
200-200: Use safe dictionary access foryear.The year extraction logic correctly prioritizes
season_air_first_date, but falls back to direct dictionary access formeta['year'], which could raiseKeyErrorif the key is missing.Apply this diff for consistency:
- tvc_name = f"{meta['title']} ({meta.get('season_air_first_date', '')[:4] if meta.get('season_air_first_date') and len(meta.get('season_air_first_date', '')) >= 4 else meta['year']}) Series {meta['season_int']} [{meta['resolution']} {type} {str(meta['video'][-3:]).upper()}]".replace(" ", " ").replace(' () ', ' ') + tvc_name = f"{meta['title']} ({meta.get('season_air_first_date', '')[:4] if meta.get('season_air_first_date') and len(meta.get('season_air_first_date', '')) >= 4 else meta.get('year', '')}) Series {meta['season_int']} [{meta['resolution']} {type} {str(meta['video'][-3:]).upper()}]".replace(" ", " ").replace(' () ', ' ')
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/trackers/TVC.py(9 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-11-06T10:21:49.286Z
Learnt from: Audionut
Repo: Audionut/Upload-Assistant PR: 986
File: src/trackers/TVC.py:451-451
Timestamp: 2025-11-06T10:21:49.286Z
Learning: In the Upload-Assistant codebase, meta['tv_pack'] is always initialized for TV content in src/getseasonep.py before tracker upload methods are called, so direct dictionary access to meta['tv_pack'] in tracker files (like TVC.py) is safe and does not require .get() method.
Applied to files:
src/trackers/TVC.py
📚 Learning: 2025-11-04T18:14:11.336Z
Learnt from: tdrkmn
Repo: Audionut/Upload-Assistant PR: 980
File: src/trackers/SHRI.py:1057-1075
Timestamp: 2025-11-04T18:14:11.336Z
Learning: In src/trackers/SHRI.py, the BBCode description generated by get_description() intentionally wraps the entire output in [code]...[/code] tags to achieve an "old-school style" where BBCode tags render as literal text rather than being parsed. This is a design preference, not a bug.
Applied to files:
src/trackers/TVC.py
🔇 Additional comments (4)
src/trackers/TVC.py (4)
42-54: LGTM - Genre mapping refactored to support foreign category.The genre-to-ID mapping has been localized and updated to include the "foreign" category (ID 43). The index-based lookup with a sensible default to "holding bin" is appropriate.
162-162: LGTM - Updated to use TVC-specific description editor.The switch from
unit3d_edit_desctotvc_edit_descwithimage_listaligns with the tracker-specific formatting requirements.
397-402: LGTM - Text wrapping utility for consistent formatting.The
format_descriptionmethod appropriately wraps long text to 100 characters per line, aligning with site formatting conventions.
451-456: LGTM - Safe dictionary access with proper text formatting.The plot section correctly uses
.get()with defaults forepisode_overviewandoverview, and applies text wrapping consistently.Based on learnings
adding HC to tvc title and description
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
♻️ Duplicate comments (1)
src/trackers/TVC.py (1)
32-36: Incomplete fix: None dates still render as "None" in titles.The past review comment requested explicit handling of
Nonedates, but the current implementation still returnsNonewhendate_strisNone(via theexceptclause catchingTypeError). This causes f-strings at lines 211 and 463 to render"None"in titles.Apply this diff to explicitly handle
Nonebefore attempting to parse:def format_date_ddmmyyyy(self, date_str): + if date_str is None: + return "" # or "TBA" if you prefer a placeholder try: return datetime.strptime(date_str, "%Y-%m-%d").strftime("%d-%m-%Y") except (ValueError, TypeError): return date_str
🧹 Nitpick comments (3)
src/trackers/TVC.py (3)
181-186: Consider simplifying nested string checks.The nested
__contains__calls are functional but verbose. Consider consolidating for readability:- if meta['type'] == "ENCODE" and ( - str(meta['path']).lower().__contains__("bluray") or str(meta['path']).lower().__contains__( - "brrip") or str(meta['path']).lower().__contains__("bdrip")): + path_lower = str(meta['path']).lower() + if meta['type'] == "ENCODE" and any(kw in path_lower for kw in ["bluray", "brrip", "bdrip"]): type = "BRRip"
483-483: Minor style: Preferinoperator over__contains__.Use the more idiomatic
inoperator instead of calling__contains__directly.- if desc.__contains__("Notes/Extra Info"): + if "Notes/Extra Info" in desc:
207-216: Rewrite review comment to address incorrect format_date_ddmmyyyy concern and clarify meta['year'] risk.The
format_date_ddmmyyyymethod never returnsNone—it returns either the formatted date string or the originaldate_stron exception (line 36), so that concern is invalid.However, line 207 should use
meta.get('year', '')instead of direct access for consistency with defensive patterns used across other trackers. While line 193 already usesmeta['year']directly (which would fail first if the key is missing), using.get()at line 207 improves resilience and aligns with the codebase convention:tvc_name = f"{meta['title']} ({meta.get('season_air_first_date', '')[:4] if meta.get('season_air_first_date') and len(meta.get('season_air_first_date', '')) >= 4 else meta.get('year', '')}) Series {meta['season_int']} [{meta['resolution']} {type} {str(meta['video'][-3:]).upper()}]".replace( " ", " ").replace(' () ', ' ')
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/trackers/TVC.py(16 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-11-06T10:21:49.313Z
Learnt from: Audionut
Repo: Audionut/Upload-Assistant PR: 986
File: src/trackers/TVC.py:451-451
Timestamp: 2025-11-06T10:21:49.313Z
Learning: In the Upload-Assistant codebase, meta['tv_pack'] is always initialized for TV content in src/getseasonep.py before tracker upload methods are called, so direct dictionary access to meta['tv_pack'] in tracker files (like TVC.py) is safe and does not require .get() method.
Applied to files:
src/trackers/TVC.py
📚 Learning: 2025-11-04T18:14:11.379Z
Learnt from: tdrkmn
Repo: Audionut/Upload-Assistant PR: 980
File: src/trackers/SHRI.py:1057-1075
Timestamp: 2025-11-04T18:14:11.379Z
Learning: In src/trackers/SHRI.py, the BBCode description generated by get_description() intentionally wraps the entire output in [code]...[/code] tags to achieve an "old-school style" where BBCode tags render as literal text rather than being parsed. This is a design preference, not a bug.
Applied to files:
src/trackers/TVC.py
🧬 Code graph analysis (1)
src/trackers/TVC.py (1)
src/rehostimages.py (1)
check_hosts(26-163)
🔇 Additional comments (5)
src/trackers/TVC.py (5)
38-53: LGTM: Category mapping refactored correctly.The changes properly refactor to local variables and update the "foreign" category ID from 42 to 43. The index-based lookup at line 50 and the fallback at line 53 are both correct and consistent.
201-202: LGTM: Hardcoded subs handling is correct.The checks use
meta.get('hardcoded-subs')safely and add appropriate warnings to both the description (lines 201-202) and the torrent name (lines 235-237).Also applies to: 235-237
412-417: LGTM: Text wrapping implementation is clean.The method correctly uses
textwrap.wrapto format descriptions at 100-character width, which aligns with TVC's formatting conventions.
461-465: Safe dictionary access, but format_date_ddmmyyyy may return None.The dictionary access patterns here are safe (using
.get()with defaults), but be aware thatformat_date_ddmmyyyyat line 463 may returnNone, which would render as"None"in the formatted string at line 465.This issue is addressed in the separate comment on lines 32-36.
344-347: Simplified error handling is cleaner but reduces debug info.Removing the full traceback at line 344 makes the output cleaner for expected errors (like missing episodes in TMDB). However, this may make debugging unexpected errors harder. The trade-off seems acceptable given the clear error message at line 345.
| # if english and not irish, scottish or welsh | ||
| if str(meta.get("original_language")).__contains__('en') and meta.get( | ||
| "original_language") not in "ga gd cy": | ||
| # setting category as foreign if original language is not english | ||
| cat_id = 43 | ||
| else: | ||
| cat_id = await self.get_cat_id(meta['genres']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Critical logic error: Language check condition is inverted.
The condition at lines 153-154 checks if original_language contains 'en', but then marks it as foreign (category 43). This contradicts:
- The inline comment (line 156): "setting category as foreign if original language is not english"
- The PR description: "If the original language is not English, the file is placed in a 'foreign' section"
Additionally, the string membership check not in "ga gd cy" at line 154 is fragile and hard to read—use a proper list instead.
Verify the intended logic and apply a fix. If foreign content should be non-English (excluding Irish/Scottish/Welsh), use:
- # if english and not irish, scottish or welsh
- if str(meta.get("original_language")).__contains__('en') and meta.get(
- "original_language") not in "ga gd cy":
- # setting category as foreign if original language is not english
+ # Non-English content (excluding Irish, Scottish Gaelic, Welsh) goes to foreign category
+ original_lang = meta.get("original_language", "")
+ if original_lang and not original_lang.startswith("en") and original_lang not in ["ga", "gd", "cy"]:
+ # Setting category as foreign if original language is not English/Irish/Scottish/Welsh
cat_id = 43
else:
cat_id = await self.get_cat_id(meta['genres'])If the current logic is actually correct for TVC's specific rules, please clarify with a comment explaining why English content is marked as "foreign."
|
|
||
| # get subs function^^^^ | ||
|
|
||
| is_other_api = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Verify usage of is_other_api attribute.
The new is_other_api = True attribute is likely used for API routing or conditional logic elsewhere in the codebase. Ensure this flag is documented or used consistently.
Run the following script to find where this attribute is referenced:
🏁 Script executed:
#!/bin/bash
# Description: Find references to is_other_api attribute
rg -n "is_other_api" --type=py -C3Length of output: 149
I need to gather more context to understand where this attribute is being set and whether it's meant to be used. Let me expand the search.
---
🏁 Script executed:
```shell
#!/bin/bash
# Get broader context around line 549 to see the class and method
sed -n '520,570p' src/trackers/TVC.py
Length of output: 1006
🏁 Script executed:
#!/bin/bash
# Search for dynamic attribute access that might reference is_other_api
rg -n "getattr|hasattr|__dict__|is_other_api" --type=py src/trackers/TVC.pyLength of output: 229
🏁 Script executed:
#!/bin/bash
# Check if is_other_api is used as part of an object/dict pattern
rg -n "self\.is_other_api|\.is_other_api|\[.*is_other_api" --type=pyLength of output: 0
🏁 Script executed:
#!/bin/bash
# Check class definition context
rg -n "^class.*:" --type=py src/trackers/TVC.py | head -20Length of output: 15
🏁 Script executed:
#!/bin/bash
# Get full method context where is_other_api is set
sed -n '500,600p' src/trackers/TVC.pyLength of output: 2286
Let me check if this class is used elsewhere and if the attribute might be referenced externally.
---
🏁 Script executed:
```shell
#!/bin/bash
# Search for any references to is_other_api in entire codebase
rg -n "is_other_api" --type=py
Length of output: 47
🏁 Script executed:
#!/bin/bash
# Check if TVC class is instantiated and this attribute accessed elsewhere
rg -n "TVC\(\)" --type=py -C2Length of output: 162
🏁 Script executed:
#!/bin/bash
# Look for any imports or references to TVC class
rg -n "from.*TVC|import.*TVC" --type=pyLength of output: 55
Remove unused class attribute or implement its intended functionality.
Verification confirms is_other_api = True at line 549 is defined but never referenced or used anywhere in the codebase. The attribute appears to be dead code or incomplete. Either remove it if no longer needed, or implement the conditional logic it was intended to support.
🤖 Prompt for AI Agents
In src/trackers/TVC.py around line 549, the class attribute "is_other_api =
True" is declared but never used; remove this dead attribute from the class
definition if it has no purpose, or if it was meant to toggle behavior,
implement its intended use by defining it as an instance attribute in __init__
(self.is_other_api) and add the necessary conditional branches where the tracker
should behave differently based on that flag (e.g., guard API-specific code
paths, adapt request/response handling, or alter metric/reporting logic),
ensuring tests cover both flag states.
adding foreign lang support for TVC and some minor improvements
note this works by checking the original language of the file to be uploaded.
if the original language is not english then its placed in foreign section. this is the case even if the show have dubbed english audio or if the audio does not have language tag which is common on TVC
Summary by CodeRabbit
Bug Fixes
Improvements
Other