from django.urls import include, path
from rest_framework.routers import DefaultRouter

from aircox.viewsets import SoundViewSet

from . import views, viewsets


__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")

api = router.urls
urls = [
    path("api/", include((api, "aircox_streamer"), namespace="api")),
    path("", views.StreamerView.as_view(), name="dashboard-streamer"),
]
