#132 | #121: backoffice / dev-1.0-121 (#131)

cfr #121

Co-authored-by: Christophe Siraut <d@tobald.eu.org>
Co-authored-by: bkfox <thomas bkfox net>
Co-authored-by: Thomas Kairos <thomas@bkfox.net>
Reviewed-on: rc/aircox#131
Co-authored-by: Chris Tactic <ctactic@noreply.git.radiocampus.be>
Co-committed-by: Chris Tactic <ctactic@noreply.git.radiocampus.be>
This commit is contained in:
2024-04-28 22:02:09 +02:00
committed by Thomas Kairos
parent 1e17a1334a
commit 55123c386d
348 changed files with 124397 additions and 17879 deletions

42
aircox_streamer/urls.py Normal file → Executable file
View File

@ -1,33 +1,25 @@
from django.contrib import admin
from django.utils.translation import gettext_lazy as _
from django.urls import include, path
from rest_framework.routers import DefaultRouter
from aircox.viewsets import SoundViewSet
from . import viewsets
from .views import StreamerAdminView
admin.site.route_view(
"tools/streamer",
StreamerAdminView.as_view(),
"tools-streamer",
label=_("Streamer Monitor"),
)
streamer_prefix = "streamer/(?P<station_pk>[0-9]+)/"
from . import views, viewsets
router = admin.site.router
router.register(
streamer_prefix + "playlist",
viewsets.PlaylistSourceViewSet,
basename="streamer-playlist",
)
router.register(
streamer_prefix + "queue",
viewsets.QueueSourceViewSet,
basename="streamer-queue",
)
__all__ = ("api", "urls")
prefix = "<int:station_pk>/"
router = DefaultRouter(use_regex_path=False)
router.register(prefix + "playlist", viewsets.PlaylistSourceViewSet, basename="streamer-playlist")
router.register(prefix + "queue", viewsets.QueueSourceViewSet, basename="streamer-queue")
router.register("streamer", viewsets.StreamerViewSet, basename="streamer")
router.register("sound", SoundViewSet, basename="sound")
urls = []
api = router.urls
urls = [
path("api/", include((api, "aircox_streamer"), namespace="api")),
path("", views.StreamerView.as_view(), name="dashboard-streamer"),
]