Fix: Include backend/audio Django app in repository
This commit is contained in:
parent
d04e726373
commit
644cfab298
37 changed files with 6632 additions and 4 deletions
46
backend/audio/urls.py
Normal file
46
backend/audio/urls.py
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
"""Audio URL patterns"""
|
||||
|
||||
from django.urls import path, include
|
||||
from rest_framework.routers import DefaultRouter
|
||||
from audio.views import (
|
||||
AudioListView,
|
||||
AudioDetailView,
|
||||
AudioPlayerView,
|
||||
AudioProgressView,
|
||||
AudioDownloadView,
|
||||
)
|
||||
from audio.views_lyrics import LyricsViewSet, LyricsCacheViewSet
|
||||
|
||||
# Create router for ViewSets
|
||||
router = DefaultRouter()
|
||||
router.register(r'lyrics', LyricsViewSet, basename='lyrics')
|
||||
router.register(r'lyrics-cache', LyricsCacheViewSet, basename='lyrics-cache')
|
||||
|
||||
urlpatterns = [
|
||||
# YouTube audio endpoints (specific paths first)
|
||||
path('list/', AudioListView.as_view(), name='audio-list'),
|
||||
path('<str:youtube_id>/player/', AudioPlayerView.as_view(), name='audio-player'),
|
||||
path('<str:youtube_id>/progress/', AudioProgressView.as_view(), name='audio-progress'),
|
||||
path('<str:youtube_id>/download/', AudioDownloadView.as_view(), name='audio-download'),
|
||||
# Lyrics endpoints
|
||||
path('<str:youtube_id>/lyrics/', LyricsViewSet.as_view({
|
||||
'get': 'retrieve',
|
||||
'put': 'update_lyrics',
|
||||
'patch': 'update_lyrics',
|
||||
'delete': 'delete_lyrics',
|
||||
}), name='audio-lyrics'),
|
||||
path('<str:youtube_id>/lyrics/fetch/', LyricsViewSet.as_view({
|
||||
'post': 'fetch',
|
||||
}), name='audio-lyrics-fetch'),
|
||||
path('<str:youtube_id>/', AudioDetailView.as_view(), name='audio-detail'),
|
||||
|
||||
# Include sub-apps LAST (they have root patterns that catch everything)
|
||||
# Local audio endpoints
|
||||
path('', include('audio.urls_local')),
|
||||
# Quick Sync endpoints
|
||||
path('', include('audio.urls_quick_sync')),
|
||||
# Artwork and metadata endpoints
|
||||
path('api/', include('audio.urls_artwork')),
|
||||
# Include router URLs for batch operations
|
||||
path('', include(router.urls)),
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue