from django.urls import path
from . import views
from django.conf import settings
from django.conf.urls.static import static

urlpatterns = [
    ### API
    path('api/', views.api_root, name="api-root"),
    path('api/track/', views.TrackListView.as_view(), name="api-tracks"),
    path('api/track/<id>', views.TrackDetailView.as_view(), name="api-track"),
    path('api/artist/<id>', views.ArtistDetailView.as_view(), name="api-artist"),
    path('api/artist', views.ArtistListView.as_view(), name="api-artists"),
    path('api/album/<id>', views.AlbumDetailView.as_view(), name="api-album"),
    path('api/album/', views.AlbumListView.as_view(), name="api-albums"),
    path('api/vote/', views.VoteListView.as_view(), name="api-votes"),
    path('api/vote/<id>', views.VoteDetailView.as_view(), name="api-vote"),
    path('api/user/', views.UserListView.as_view(), name="api-users"),
    path('api/user/<int:id>', views.UserDetailView.as_view(), name="api-user"),
    path('api/user/<int:user_id>/votes', views.VoteListView.as_view(), name="api-user-votes"),
    path('api/profile/<int:id>', views.ProfileDetailView.as_view(), name="api-profile"),
    path('api/profile/background', views.BackgroundListView.as_view(), name="api-backgrounds"),
    path('api/profile/background/<int:id>', views.BackgroundDetailView.as_view(), name="api-background"),

    ### Classic
    path('track/', views.NominateView.as_view(), name="nominate"),
    path('vote/', views.VoteView.as_view(), name="vote"),
    path('vote/undo', views.UndoView.as_view(), name="undo"),
    path('vote/skip', views.SkipView.as_view(), name="skip"),
    path('settings/', views.SettingsView.as_view(), name="settings"),
    path('settings/playlist-import', views.PlaylistImportView.as_view(), name="playlist-import"),
    path('overview/', views.OverView.as_view(), name="overview"),
    path('overview/playlist', views.PlaylistListView.as_view(), name="playlist-list"),
    path('overview/playlist/<int:id>', views.PlaylistDetailView.as_view(), name="playlist-detail"),
    path('spotify/callback', views.SpotifyCallbackView.as_view(), name="spotify-callback"),
    path('stroopwafel', views.StroopwafelView.as_view(), name="stroopwafel"),
    path('', views.AuthView.as_view()),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
