From e305f1cba008d9b8a94a9dc24ab5f0f758094ea6 Mon Sep 17 00:00:00 2001 From: Dispatcharr Date: Thu, 6 Mar 2025 18:43:14 -0600 Subject: [PATCH] Fixed HDHR Changed URLs so they would properly work as a HDHR device. --- apps/hdhr/api_views.py | 2 +- apps/hdhr/views.py | 2 +- dispatcharr/urls.py | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/apps/hdhr/api_views.py b/apps/hdhr/api_views.py index dbc0d02d..844ee8fe 100644 --- a/apps/hdhr/api_views.py +++ b/apps/hdhr/api_views.py @@ -81,7 +81,7 @@ class LineupAPIView(APIView): { "GuideNumber": str(ch.channel_number), "GuideName": ch.channel_name, - "URL": request.build_absolute_uri(f"/player/stream/{ch.id}") + "URL": request.build_absolute_uri(f"/output/stream/{ch.id}") } for ch in channels ] diff --git a/apps/hdhr/views.py b/apps/hdhr/views.py index dbc0d02d..844ee8fe 100644 --- a/apps/hdhr/views.py +++ b/apps/hdhr/views.py @@ -81,7 +81,7 @@ class LineupAPIView(APIView): { "GuideNumber": str(ch.channel_number), "GuideName": ch.channel_name, - "URL": request.build_absolute_uri(f"/player/stream/{ch.id}") + "URL": request.build_absolute_uri(f"/output/stream/{ch.id}") } for ch in channels ] diff --git a/dispatcharr/urls.py b/dispatcharr/urls.py index e9595cbf..5424a197 100644 --- a/dispatcharr/urls.py +++ b/dispatcharr/urls.py @@ -7,6 +7,8 @@ from rest_framework import permissions from drf_yasg.views import get_schema_view from drf_yasg import openapi from .routing import websocket_urlpatterns +from apps.hdhr.api_views import HDHRDeviceViewSet, DiscoverAPIView, LineupAPIView, LineupStatusAPIView, HDHRDeviceXMLAPIView, hdhr_dashboard_view + # Define schema_view for Swagger schema_view = get_schema_view( @@ -39,6 +41,12 @@ urlpatterns = [ path('hdhr', RedirectView.as_view(url='/hdhr/', permanent=True)), # This fixes the issue path('hdhr/', include(('apps.hdhr.urls', 'hdhr'), namespace='hdhr')), + path('discover.json', DiscoverAPIView.as_view(), name='discover'), + path('lineup.json', LineupAPIView.as_view(), name='lineup'), + path('lineup_status.json', LineupStatusAPIView.as_view(), name='lineup_status'), + path('device.xml', HDHRDeviceXMLAPIView.as_view(), name='device_xml'), + + # Swagger UI path('swagger/', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),