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

Add filtering for movie and series category IDs#64

Open
mjulian87 wants to merge 3 commits into
cmc0619:mainfrom
mjulian87:main
Open

Add filtering for movie and series category IDs#64
mjulian87 wants to merge 3 commits into
cmc0619:mainfrom
mjulian87:main

Conversation

@mjulian87

@mjulian87 mjulian87 commented Mar 10, 2026

Copy link
Copy Markdown

Allow filtering strm output by movie/series category IDs.

Summary by CodeRabbit

  • New Features
    • Added category-based content filtering for movies and series, allowing inclusion by provider category IDs alongside existing ID-based filters.
    • Exposed two new fields in the UI/schema: Movie Category IDs and Series Category IDs, with usage guidance.
    • Clarified Movie IDs help text to reference movie-specific IDs.
    • Filtering now applies combined ID-or-category criteria and returns distinct results to avoid duplicates.

@coderabbitai

coderabbitai Bot commented Mar 10, 2026

Copy link
Copy Markdown

Walkthrough

Adds two Plugin fields, filter_movie_category_ids and filter_series_category_ids, updates filter_movie_ids help text, and extends eligible movie/series querysets to include items matching either explicit IDs or related M3U category IDs via combined OR conditions with .distinct().

Changes

Cohort / File(s) Summary
Plugin filtering & schema
plugin.py
Added filter_movie_category_ids and filter_series_category_ids fields; updated filter_movie_ids help text; parsing now builds category_id lists and updates _eligible_movie_queryset / _eligible_series_queryset to OR-match item IDs or related M3U category IDs, applying .distinct().
Manifest / Analyzer
manifest (lines changed), manifest_file_analyzer (lines changed)
Manifest-related entries updated; analyzer lines changed to reflect additions (+62/-9 and +75/-9 reported).

Sequence Diagram(s)

(omitted — changes are internal filtering additions without multi-component sequential interactions)

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add filtering for movie and series category IDs' directly and clearly summarizes the main change in the PR, which adds category-based filtering functionality for both movies and series.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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


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.

🧹 Nitpick comments (1)
plugin.py (1)

1830-1856: Inconsistent indentation in field definitions.

The field definitions for content filtering have 4-space indentation for dictionary keys, while all other fields in the fields list use 8-space indentation. This is a stylistic inconsistency that should be corrected for maintainability.

♻️ Fix indentation to match surrounding code
-    "id": "filter_movie_ids",
-    "label": "Content Filter: Movie IDs",
-    "type": "string",
-    "default": "",
-    "help": "Comma-separated movie database IDs to include (e.g., '11730,14359'). Leave empty to include all.",
-},
-{
-    "id": "filter_movie_category_ids",
-    "label": "Content Filter: Movie Category IDs",
-    "type": "string",
-    "default": "",
-    "help": "Comma-separated provider category IDs (e.g., '12,15'). Movies from these categories will be included.",
-},
-{
-    "id": "filter_series_ids",
-    "label": "Content Filter: Series IDs",
-    "type": "string",
-    "default": "",
-    "help": "Comma-separated series database IDs to include (e.g., '1521,1797,2736'). Leave empty to include all.",
-},
-{
-    "id": "filter_series_category_ids",
-    "label": "Content Filter: Series Category IDs",
-    "type": "string",
-    "default": "",
-    "help": "Comma-separated provider category IDs (e.g., '3,9'). Series from these categories will be included.",
-},
+        {
+            "id": "filter_movie_ids",
+            "label": "Content Filter: Movie IDs",
+            "type": "string",
+            "default": "",
+            "help": "Comma-separated movie database IDs to include (e.g., '11730,14359'). Leave empty to include all.",
+        },
+        {
+            "id": "filter_movie_category_ids",
+            "label": "Content Filter: Movie Category IDs",
+            "type": "string",
+            "default": "",
+            "help": "Comma-separated provider category IDs (e.g., '12,15'). Movies from these categories will be included.",
+        },
+        {
+            "id": "filter_series_ids",
+            "label": "Content Filter: Series IDs",
+            "type": "string",
+            "default": "",
+            "help": "Comma-separated series database IDs to include (e.g., '1521,1797,2736'). Leave empty to include all.",
+        },
+        {
+            "id": "filter_series_category_ids",
+            "label": "Content Filter: Series Category IDs",
+            "type": "string",
+            "default": "",
+            "help": "Comma-separated provider category IDs (e.g., '3,9'). Series from these categories will be included.",
+        },
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugin.py` around lines 1830 - 1856, The four filter field dicts
("filter_movie_ids", "filter_movie_category_ids", "filter_series_ids",
"filter_series_category_ids") are indented with 4 spaces while the surrounding
entries use 8; update these entries so their opening braces and all keys use the
same 8-space indentation as the other items in the fields list to restore
consistent style (adjust the lines containing those id strings and their keys
accordingly).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@plugin.py`:
- Around line 1830-1856: The four filter field dicts ("filter_movie_ids",
"filter_movie_category_ids", "filter_series_ids", "filter_series_category_ids")
are indented with 4 spaces while the surrounding entries use 8; update these
entries so their opening braces and all keys use the same 8-space indentation as
the other items in the fields list to restore consistent style (adjust the lines
containing those id strings and their keys accordingly).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d14abaa4-1079-47c0-8a38-fa430f9f1eb5

📥 Commits

Reviewing files that changed from the base of the PR and between e06e76c and 7b2753a.

📒 Files selected for processing (1)
  • plugin.py

@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: 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 `@plugin.py`:
- Around line 174-178: The category filter currently uses a raw join
(m3u_relations__category_id__in=...) which bypasses the constrained/eligible
relation predicate used when building base_qs; replace that category arm with
the same constrained relation queryset used earlier (i.e., reuse the
relation-filter expression or annotated relation queryset that was applied to
build base_qs) so the category match is scoped to the same eligible relations,
and make the identical change for the other occurrence around the 226-230 block.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c3876f3e-f715-496c-84db-daf88f856397

📥 Commits

Reviewing files that changed from the base of the PR and between 7b2753a and 626ebbf.

📒 Files selected for processing (1)
  • plugin.py

Comment thread plugin.py Outdated

@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.

🧹 Nitpick comments (1)
plugin.py (1)

156-172: Consider extracting ID parsing into a helper function.

The same parsing pattern is duplicated for movies (lines 160-172) and series (lines 219-231). A small helper would reduce duplication:

♻️ Optional refactor
def _parse_id_list(csv_string: str) -> list[int]:
    """Parse comma-separated integer IDs, ignoring invalid values."""
    if not csv_string:
        return []
    return [
        int(x.strip())
        for x in csv_string.split(',')
        if x.strip().isdigit()
    ]

Then use as:

movie_ids = _parse_id_list(filter_movie_ids_str)
category_ids = _parse_id_list(filter_movie_category_ids_str)

Also applies to: 216-231

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugin.py` around lines 156 - 172, The parsing logic for movie_ids and
category_ids (the blocks using filter_movie_ids_str and
filter_movie_category_ids_str) is duplicated later for series; extract it into a
small helper like _parse_id_list(csv_string: str) -> list[int] that returns []
for falsy input and parses comma-separated integers while ignoring invalid
tokens, then replace the inline list comprehensions for movie_ids, category_ids
and the series equivalents with calls to _parse_id_list(filter_movie_ids_str),
_parse_id_list(filter_movie_category_ids_str) (and the corresponding series
variables) to remove duplication and centralize validation.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@plugin.py`:
- Around line 156-172: The parsing logic for movie_ids and category_ids (the
blocks using filter_movie_ids_str and filter_movie_category_ids_str) is
duplicated later for series; extract it into a small helper like
_parse_id_list(csv_string: str) -> list[int] that returns [] for falsy input and
parses comma-separated integers while ignoring invalid tokens, then replace the
inline list comprehensions for movie_ids, category_ids and the series
equivalents with calls to _parse_id_list(filter_movie_ids_str),
_parse_id_list(filter_movie_category_ids_str) (and the corresponding series
variables) to remove duplication and centralize validation.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6eb0f013-90ec-455a-9fc6-66d1703ec682

📥 Commits

Reviewing files that changed from the base of the PR and between 626ebbf and 2784803.

📒 Files selected for processing (1)
  • plugin.py

dstosch pushed a commit to dstosch/vod2strm that referenced this pull request Apr 3, 2026
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