diff --git a/tubearchivist/home/templates/home/channel_id.html b/tubearchivist/home/templates/home/channel_id.html
index 57d1e050..a4e7f749 100644
--- a/tubearchivist/home/templates/home/channel_id.html
+++ b/tubearchivist/home/templates/home/channel_id.html
@@ -8,7 +8,7 @@
diff --git a/tubearchivist/home/templates/home/channel_id_about.html b/tubearchivist/home/templates/home/channel_id_about.html
index 3650e8bb..cbf4ce7a 100644
--- a/tubearchivist/home/templates/home/channel_id_about.html
+++ b/tubearchivist/home/templates/home/channel_id_about.html
@@ -8,7 +8,7 @@
@@ -61,7 +61,7 @@
{% endif %}
{% endblock content %}
\ No newline at end of file
diff --git a/tubearchivist/home/templates/home/channel_id_playlist.html b/tubearchivist/home/templates/home/channel_id_playlist.html
new file mode 100644
index 00000000..a1733f79
--- /dev/null
+++ b/tubearchivist/home/templates/home/channel_id_playlist.html
@@ -0,0 +1,46 @@
+{% extends "home/base.html" %}
+{% block content %}
+{% load static %}
+{% load humanize %}
+
+
+

+
+
+
+
+

+

+
+
+
+ {% if results %}
+ {% for playlist in results %}
+
+ {% endfor %}
+ {% else %}
+
No playlists found...
+ {% endif %}
+
+
+{% endblock content %}
\ No newline at end of file
diff --git a/tubearchivist/home/urls.py b/tubearchivist/home/urls.py
index b40c403f..521ed3b2 100644
--- a/tubearchivist/home/urls.py
+++ b/tubearchivist/home/urls.py
@@ -7,6 +7,7 @@ from django.urls import path
from home.views import (
AboutView,
ChannelIdAboutView,
+ ChannelIdPlaylistView,
ChannelIdView,
ChannelView,
DownloadView,
@@ -48,6 +49,11 @@ urlpatterns = [
login_required(ChannelIdAboutView.as_view()),
name="channel_id_about",
),
+ path(
+ "channel/
/playlist/",
+ login_required(ChannelIdPlaylistView.as_view()),
+ name="channel_id_playlist",
+ ),
path(
"video//",
login_required(VideoView.as_view()),
diff --git a/tubearchivist/home/views.py b/tubearchivist/home/views.py
index 18604c81..2519e32a 100644
--- a/tubearchivist/home/views.py
+++ b/tubearchivist/home/views.py
@@ -442,7 +442,6 @@ class ChannelIdView(ArchivistResultsView):
{
"title": "Channel: " + channel_name,
"channel_info": channel_info,
- "channel_overwrite_form": ChannelOverwriteForm,
}
)
@@ -506,6 +505,62 @@ class ChannelIdAboutView(ArchivistResultsView):
return render(request, "home/channel_id_about.html", self.context)
+ @staticmethod
+ def post(request, channel_id):
+ """handle post request"""
+ print(f"handle post from {channel_id}")
+ channel_overwrite_form = ChannelOverwriteForm(request.POST)
+ if channel_overwrite_form.is_valid():
+ overwrites = channel_overwrite_form.cleaned_data
+ print(f"{channel_id}: set overwrites {overwrites}")
+ channel_overwrites(channel_id, overwrites=overwrites)
+ if overwrites.get("index_playlists") == "1":
+ index_channel_playlists.delay(channel_id)
+
+ sleep(1)
+ return redirect("channel_id_about", channel_id, permanent=True)
+
+
+class ChannelIdPlaylistView(ArchivistResultsView):
+ """resolves to /channel//playlist/
+ show all playlists of channel
+ """
+
+ view_origin = "playlist"
+ es_search = "ta_playlist/_search"
+
+ def get(self, request, channel_id):
+ """handle get request"""
+ self.initiate_vars(request)
+ self._update_view_data(channel_id)
+ self.find_results()
+
+ channel_info = self._get_channel_meta(channel_id)
+ channel_name = channel_info["channel_name"]
+ self.context.update(
+ {
+ "title": "Channel: Playlists " + channel_name,
+ "channel_info": channel_info,
+ }
+ )
+
+ return render(request, "home/channel_id_playlist.html", self.context)
+
+ def _update_view_data(self, channel_id):
+ """update view specific data dict"""
+ self.data["sort"] = [{"playlist_name.keyword": {"order": "asc"}}]
+ self.data["query"] = {
+ "term": {"playlist_channel_id": {"value": channel_id}}
+ }
+
+ def _get_channel_meta(self, channel_id):
+ """get metadata for channel"""
+ path = f"ta_channel/_doc/{channel_id}"
+ response, _ = ElasticWrap(path).get()
+ channel_info = SearchProcess(response).process()
+
+ return channel_info
+
class ChannelView(ArchivistResultsView):
"""resolves to /channel/