Skip to content

feat(trackers): add VietMediaF (VMF) tracker support#1285

Closed
bioidaika wants to merge 2 commits intoAudionut:masterfrom
bioidaika:feat/add-vmf-tracker
Closed

feat(trackers): add VietMediaF (VMF) tracker support#1285
bioidaika wants to merge 2 commits intoAudionut:masterfrom
bioidaika:feat/add-vmf-tracker

Conversation

@bioidaika
Copy link
Copy Markdown

@bioidaika bioidaika commented Mar 9, 2026

Add VietMediaF tracker (UNIT3D-based Vietnamese private tracker). Includes VMF.py with category/type/resolution mappings and trackersetup.py integration.

Summary by CodeRabbit

  • New Features
    • Added support for the VMF tracker with automatic metadata mapping for categories, types, and resolutions to ensure compatible formatting for tracker operations.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 9, 2026

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
Copy link
Copy Markdown

coderabbitai Bot commented Mar 9, 2026

📝 Walkthrough

Walkthrough

A new tracker implementation for VMF is introduced, subclassing UNIT3D and providing async methods to map metadata fields (category, type, resolution) to tracker-specific identifiers. The tracker is registered in the application's tracker registry and API tracker list.

Changes

Cohort / File(s) Summary
New VMF Tracker Implementation
src/trackers/VMF.py
Adds VMF class inheriting from UNIT3D with tracker endpoints, banned groups, and three async helper methods (get_category_id, get_type_id, get_resolution_id) for mapping metadata to tracker-specific IDs. Includes Meta and Config type aliases.
Tracker Registry Integration
src/trackersetup.py
Imports VMF module and registers the tracker in tracker_class_map and api_trackers set for API-based lookups.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A new tracker hops into place,
VMF joins the torrent race,
Maps each meta field with care,
Categories, types, resolutions fair,
The burrow of trackers grows more wide!

🚥 Pre-merge checks | ✅ 2 | ❌ 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 (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding support for the VietMediaF (VMF) tracker, which is the primary focus of the changeset across both VMF.py and trackersetup.py.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a 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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/trackers/VMF.py`:
- Around line 25-76: The overrides get_category_id, get_type_id, and
get_resolution_id currently ignore mapping_only and always return payload dicts;
update each function (get_category_id, get_type_id, get_resolution_id) to build
the mapping dict first, then if mapping_only is True return that mapping (so
callers can do mapping.get(meta_value)), otherwise derive the id using the
mapping and return the payload-shaped dict (e.g., {'category_id': id}). Keep
using meta['category']/meta['type']/meta['resolution'] for lookups and preserve
the default fallback values currently used.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6d5b5055-8662-40ef-9760-4bcf9b48447a

📥 Commits

Reviewing files that changed from the base of the PR and between cb8964c and d2de435.

📒 Files selected for processing (2)
  • src/trackers/VMF.py
  • src/trackersetup.py

Comment thread src/trackers/VMF.py
Comment on lines +25 to +76
async def get_category_id(
self,
meta: Meta,
category: Optional[str] = None,
reverse: bool = False,
mapping_only: bool = False,
) -> dict[str, str]:
_ = (category, reverse, mapping_only)
category_id = {
'MOVIE': '1',
'TV': '2',
}.get(meta['category'], '0')
return {'category_id': category_id}

async def get_type_id(
self,
meta: Meta,
type: Optional[str] = None,
reverse: bool = False,
mapping_only: bool = False,
) -> dict[str, str]:
_ = (type, reverse, mapping_only)
type_id = {
'DISC': '1',
'REMUX': '2',
'ENCODE': '3',
'WEBDL': '4',
'WEBRIP': '5',
'HDTV': '6',
}.get(meta['type'], '0')
return {'type_id': type_id}

async def get_resolution_id(
self,
meta: Meta,
resolution: Optional[str] = None,
reverse: bool = False,
mapping_only: bool = False,
) -> dict[str, str]:
_ = (resolution, reverse, mapping_only)
resolution_id = {
'4320p': '1',
'2160p': '2',
'1080p': '3',
'1080i': '4',
'720p': '5',
'576p': '6',
'576i': '7',
'480p': '8',
'480i': '9',
}.get(meta['resolution'], '10')
return {'resolution_id': resolution_id}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Honor the UNIT3D mapping contract in these overrides.

Lines 32, 46, and 64 discard mapping_only=True and always return payload-shaped dicts keyed by category_id / type_id / resolution_id. src/trackersetup.py later calls these helpers with mapping_only=True and does mapping.get(meta_value), so VMF ends up with None for every category/type/resolution lookup. That breaks request matching and claim matching for this tracker.

🔧 Suggested fix
-    async def get_category_id(
-        self,
-        meta: Meta,
-        category: Optional[str] = None,
-        reverse: bool = False,
-        mapping_only: bool = False,
-    ) -> dict[str, str]:
-        _ = (category, reverse, mapping_only)
-        category_id = {
+    async def get_category_id(
+        self,
+        meta: Meta,
+        category: str = "",
+        reverse: bool = False,
+        mapping_only: bool = False,
+    ) -> dict[str, str]:
+        _ = reverse
+        category_map = {
             'MOVIE': '1',
             'TV': '2',
-        }.get(meta['category'], '0')
-        return {'category_id': category_id}
+        }
+        if mapping_only:
+            return category_map
+        selected = category or meta['category']
+        return {'category_id': category_map.get(selected, '0')}
 
     async def get_type_id(
         self,
         meta: Meta,
-        type: Optional[str] = None,
+        type: str = "",
         reverse: bool = False,
         mapping_only: bool = False,
     ) -> dict[str, str]:
-        _ = (type, reverse, mapping_only)
-        type_id = {
+        _ = reverse
+        type_map = {
             'DISC': '1',
             'REMUX': '2',
             'ENCODE': '3',
             'WEBDL': '4',
             'WEBRIP': '5',
             'HDTV': '6',
-        }.get(meta['type'], '0')
-        return {'type_id': type_id}
+        }
+        if mapping_only:
+            return type_map
+        selected = type or meta['type']
+        return {'type_id': type_map.get(selected, '0')}
 
     async def get_resolution_id(
         self,
         meta: Meta,
-        resolution: Optional[str] = None,
+        resolution: str = "",
         reverse: bool = False,
         mapping_only: bool = False,
     ) -> dict[str, str]:
-        _ = (resolution, reverse, mapping_only)
-        resolution_id = {
+        _ = reverse
+        resolution_map = {
             '4320p': '1',
             '2160p': '2',
             '1080p': '3',
             '1080i': '4',
             '720p': '5',
             '576p': '6',
             '576i': '7',
             '480p': '8',
             '480i': '9',
-        }.get(meta['resolution'], '10')
-        return {'resolution_id': resolution_id}
+        }
+        if mapping_only:
+            return resolution_map
+        selected = resolution or meta['resolution']
+        return {'resolution_id': resolution_map.get(selected, '10')}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/trackers/VMF.py` around lines 25 - 76, The overrides get_category_id,
get_type_id, and get_resolution_id currently ignore mapping_only and always
return payload dicts; update each function (get_category_id, get_type_id,
get_resolution_id) to build the mapping dict first, then if mapping_only is True
return that mapping (so callers can do mapping.get(meta_value)), otherwise
derive the id using the mapping and return the payload-shaped dict (e.g.,
{'category_id': id}). Keep using
meta['category']/meta['type']/meta['resolution'] for lookups and preserve the
default fallback values currently used.

@bioidaika bioidaika closed this Apr 23, 2026
@bioidaika bioidaika deleted the feat/add-vmf-tracker branch April 23, 2026 14:39
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