Code review changes

This commit is contained in:
Seth Van Niekerk 2026-05-02 16:59:50 -04:00
parent dec92ecd31
commit 0d3eed81ba
No known key found for this signature in database
GPG key ID: E86ACA677312A675
3 changed files with 9 additions and 18 deletions

View file

@ -564,6 +564,9 @@ def stream_xc(request, username, password, channel_id):
extension = pathlib.Path(channel_id).suffix
channel_id = pathlib.Path(channel_id).stem
if not network_access_allowed(request, 'STREAMS', user):
return Response({"error": "Forbidden"}, status=403)
custom_properties = user.custom_properties or {}
if "xc_password" not in custom_properties:
@ -572,9 +575,6 @@ def stream_xc(request, username, password, channel_id):
if custom_properties["xc_password"] != password:
return Response({"error": "Invalid credentials"}, status=401)
if not network_access_allowed(request, 'STREAMS', user):
return Response({"error": "Invalid credentials"}, status=401)
if user.user_level < 10:
user_profile_count = user.channel_profiles.count()

View file

@ -1023,6 +1023,9 @@ def stream_xc_movie(request, username, password, stream_id, extension):
user = get_object_or_404(User, username=username)
if not network_access_allowed(request, 'STREAMS', user):
return Response({"error": "Forbidden"}, status=403)
custom_properties = user.custom_properties or {}
if "xc_password" not in custom_properties:
@ -1031,9 +1034,6 @@ def stream_xc_movie(request, username, password, stream_id, extension):
if custom_properties["xc_password"] != password:
return Response({"error": "Invalid credentials"}, status=401)
if not network_access_allowed(request, 'STREAMS', user):
return Response({"error": "Invalid credentials"}, status=401)
# All authenticated users get access to VOD from all active M3U accounts
filters = {"movie_id": stream_id, "m3u_account__is_active": True}
@ -1060,6 +1060,9 @@ def stream_xc_episode(request, username, password, stream_id, extension):
user = get_object_or_404(User, username=username)
if not network_access_allowed(request, 'STREAMS', user):
return Response({"error": "Forbidden"}, status=403)
custom_properties = user.custom_properties or {}
if "xc_password" not in custom_properties:
@ -1068,9 +1071,6 @@ def stream_xc_episode(request, username, password, stream_id, extension):
if custom_properties["xc_password"] != password:
return Response({"error": "Invalid credentials"}, status=401)
if not network_access_allowed(request, 'STREAMS', user):
return Response({"error": "Invalid credentials"}, status=401)
# All authenticated users get access to series/episodes from all active M3U accounts
filters = {"episode_id": stream_id, "m3u_account__is_active": True}