diff --git a/tubearchivist/home/templates/home/home.html b/tubearchivist/home/templates/home/home.html index d24263a..9d51714 100644 --- a/tubearchivist/home/templates/home/home.html +++ b/tubearchivist/home/templates/home/home.html @@ -2,6 +2,46 @@ {% block content %} {% load static %}
+ {% if continue_vids %} +
+

Continue Watching

+
+
+ {% for video in continue_vids %} +
+ +
+
+ video-thumb + {% if video.player.progress %} +
+ {% else %} +
+ {% endif %} +
+
+ play-icon +
+
+
+
+
+ {% if video.player.watched %} + seen-icon + {% else %} + unseen-icon + {% endif %} + {{ video.published }} | {{ video.player.duration_str }} +
+
+

{{ video.channel.channel_name }}

+

{{ video.title }}

+
+
+
+ {% endfor %} +
+ {% endif %}

Recent Videos

diff --git a/tubearchivist/home/views.py b/tubearchivist/home/views.py index dd87ac0..781b690 100644 --- a/tubearchivist/home/views.py +++ b/tubearchivist/home/views.py @@ -175,6 +175,7 @@ class ArchivistResultsView(ArchivistViewConfig): if not results or not self.context["results"]: return + self.context["continue_vids"] = [] progress = {i["youtube_id"]: i["position"] for i in results} for hit in self.context["results"]: video = hit["source"] @@ -182,6 +183,7 @@ class ArchivistResultsView(ArchivistViewConfig): played_sec = progress.get(video["youtube_id"]) total = video["player"]["duration"] video["player"]["progress"] = 100 * (played_sec / total) + self.context["continue_vids"].append(video) def single_lookup(self, es_path): """retrieve a single item from url""" diff --git a/tubearchivist/static/css/style.css b/tubearchivist/static/css/style.css index 22e1b2e..8f124d3 100644 --- a/tubearchivist/static/css/style.css +++ b/tubearchivist/static/css/style.css @@ -370,16 +370,18 @@ button:hover { } /* video list */ -.video-list.grid { +.video-list { display: grid; - grid-template-columns: 1fr 1fr 1fr; grid-gap: 1rem; + margin-top: 1rem; +} + +.video-list.grid { + grid-template-columns: 1fr 1fr 1fr; } .video-list.list { - display: grid; grid-template-columns: unset; - grid-gap: 1rem; } .video-item {