From d5ad0d007c0f6ef23a9d617106da630353b51c17 Mon Sep 17 00:00:00 2001 From: Mike0001-droid Date: Tue, 25 Jun 2024 13:14:50 +0500 Subject: [PATCH] =?UTF-8?q?=D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB=20?= =?UTF-8?q?=D0=B7=D0=B0=D0=BF=D1=80=D0=BE=D1=81=20=D0=B4=D0=BB=D1=8F=20?= =?UTF-8?q?=D0=BF=D0=BE=D0=BB=D1=83=D1=87=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=BF?= =?UTF-8?q?=D0=BB=D0=B5=D0=B5=D1=80=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/proj/audio/views.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/server/proj/audio/views.py b/server/proj/audio/views.py index ac0f5eb..a156037 100644 --- a/server/proj/audio/views.py +++ b/server/proj/audio/views.py @@ -243,6 +243,17 @@ class SongViewSet(GenericViewSet): data.append(i) return Response(data, status=status.HTTP_200_OK) + @action(detail=False, methods=['get']) + def get_nowplaying(self, request): + file_url = F"{AZURACAST_URL}api/nowplaying/it-radio" + API_KEY = AZURACAST_API_KEY + headers = { + "Authorization": f"Bearer {API_KEY}" + } + response = requests.get(file_url, headers=headers) + return Response(response.json(), status=status.HTTP_200_OK) + +