Merge pull request #784 from Vitekant:fix/vod-category-pipe-parsing

Fix VOD category filtering for names containing pipe "|" characters
This commit is contained in:
SergeantPanda 2026-01-01 18:28:07 -06:00 committed by GitHub
commit 33f988b2c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -62,7 +62,7 @@ class MovieFilter(django_filters.FilterSet):
# Handle the format 'category_name|category_type'
if '|' in value:
category_name, category_type = value.split('|', 1)
category_name, category_type = value.rsplit('|', 1)
return queryset.filter(
m3u_relations__category__name=category_name,
m3u_relations__category__category_type=category_type
@ -219,7 +219,7 @@ class SeriesFilter(django_filters.FilterSet):
# Handle the format 'category_name|category_type'
if '|' in value:
category_name, category_type = value.split('|', 1)
category_name, category_type = value.rsplit('|', 1)
return queryset.filter(
m3u_relations__category__name=category_name,
m3u_relations__category__category_type=category_type
@ -588,7 +588,7 @@ class UnifiedContentViewSet(viewsets.ReadOnlyModelViewSet):
if category:
if '|' in category:
cat_name, cat_type = category.split('|', 1)
cat_name, cat_type = category.rsplit('|', 1)
if cat_type == 'movie':
where_conditions[0] += " AND movies.id IN (SELECT movie_id FROM vod_m3umovierelation mmr JOIN vod_vodcategory c ON mmr.category_id = c.id WHERE c.name = %s)"
where_conditions[1] = "1=0" # Exclude series