from django.urls import path
from django.conf.urls import url

from . import views

app_name = 'media'
urlpatterns = [
    # Homepage
    path('', views.IndexView.as_view(), name='index'),
    
    # Filtered view
    path('film/', views.OnlyFilmView.as_view(), name='film_list'),
    path('series/', views.OnlySeriesView.as_view(), name='series_list'),
    path('video/', views.OnlyVideoView.as_view(), name='video_list'),
    path('stream/', views.OnlyStreamView.as_view(), name='stream_list'),

    # Page with player
    path('film/<str:pk>/', views.FilmView.as_view(), name='film'),
    path('series/<str:pk>/', views.SeriesView.as_view(), name='series'),
    path('video/<str:pk>/', views.VideoView.as_view(), name='video'),
    path('stream/<str:pk>/', views.StreamView.as_view(), name='stream'),
    path('series/<str:title>/<str:pk>/', views.SerieEpisodeView.as_view(), name='episode'),

    # Requests
    url(r'devices', views.searchDevices, name="refreshDevices"),
    url(r'applyFilter', views.getMedia, name="filterMedia"),
    url(r'cast', views.cast, name="cast")
]