diff --git a/vrobbler/apps/scrobbles/forms.py b/vrobbler/apps/scrobbles/forms.py index 537cb72..b1f3956 100644 --- a/vrobbler/apps/scrobbles/forms.py +++ b/vrobbler/apps/scrobbles/forms.py @@ -1,5 +1,5 @@ from django import forms -class ScrobbleForm(forms.Form): +class ImdbScrobbleForm(forms.Form): imdb_id = forms.CharField(label="IMDB", max_length=30) diff --git a/vrobbler/apps/scrobbles/views.py b/vrobbler/apps/scrobbles/views.py index 94f9985..497d879 100644 --- a/vrobbler/apps/scrobbles/views.py +++ b/vrobbler/apps/scrobbles/views.py @@ -16,7 +16,6 @@ from scrobbles.constants import ( JELLYFIN_AUDIO_ITEM_TYPES, JELLYFIN_VIDEO_ITEM_TYPES, ) -from scrobbles.forms import ScrobbleForm from scrobbles.imdb import lookup_video_from_imdb from scrobbles.models import Scrobble from scrobbles.scrobblers import ( @@ -34,6 +33,7 @@ from vrobbler.apps.music.aggregators import ( top_tracks, week_of_scrobbles, ) +from scrobbles.forms import ImdbScrobbleForm logger = logging.getLogger(__name__) @@ -77,6 +77,7 @@ class RecentScrobbleList(ListView): data["weekly_data"] = week_of_scrobbles() data['counts'] = scrobble_counts() + data['imdb_form'] = ImdbScrobbleForm return data def get_queryset(self): @@ -86,7 +87,7 @@ class RecentScrobbleList(ListView): class ManualImdbScrobbleView(FormView): - form_class = ScrobbleForm + form_class = ImdbScrobbleForm template_name = 'scrobbles/manual_form.html' def form_valid(self, form): diff --git a/vrobbler/templates/scrobbles/scrobble_list.html b/vrobbler/templates/scrobbles/scrobble_list.html index 9e2a729..605dec3 100644 --- a/vrobbler/templates/scrobbles/scrobble_list.html +++ b/vrobbler/templates/scrobbles/scrobble_list.html @@ -7,7 +7,13 @@

Dashboard

+
+
+ {% csrf_token %} + {{ imdb_form }} + +
diff --git a/vrobbler/urls.py b/vrobbler/urls.py index d79f007..b152ea1 100644 --- a/vrobbler/urls.py +++ b/vrobbler/urls.py @@ -18,7 +18,7 @@ urlpatterns = [ path( 'manual/imdb/', scrobbles_views.ManualImdbScrobbleView.as_view(), - name='manual-scrobble', + name='imdb-manual-scrobble', ), path("", include(video_urls, namespace="videos")), path("", scrobbles_views.RecentScrobbleList.as_view(), name="home"),