add video progress bar to channel_id and playlist_id views

This commit is contained in:
simon 2022-02-24 19:30:12 +07:00
parent d88d6d6a61
commit df777104af
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4
3 changed files with 8 additions and 0 deletions

View File

@ -110,6 +110,9 @@
<div class="video-thumb-wrap {{ view_style }}"> <div class="video-thumb-wrap {{ view_style }}">
<div class="video-thumb"> <div class="video-thumb">
<img src="/cache/{{ video.source.vid_thumb_url }}" alt="video-thumb"> <img src="/cache/{{ video.source.vid_thumb_url }}" alt="video-thumb">
{% if video.source.player.progress %}
<div class="video-progress-bar" id="progress-{{ video.source.youtube_id }}" style="width: {{video.source.player.progress}}%;"></div>
{% endif %}
</div> </div>
<div class="video-play"> <div class="video-play">
<img src="{% static 'img/icon-play.svg' %}" alt="play-icon"> <img src="{% static 'img/icon-play.svg' %}" alt="play-icon">

View File

@ -91,6 +91,9 @@
<div class="video-thumb-wrap {{ view_style }}"> <div class="video-thumb-wrap {{ view_style }}">
<div class="video-thumb"> <div class="video-thumb">
<img src="/cache/{{ video.source.vid_thumb_url }}" alt="video-thumb"> <img src="/cache/{{ video.source.vid_thumb_url }}" alt="video-thumb">
{% if video.source.player.progress %}
<div class="video-progress-bar" id="progress-{{ video.source.youtube_id }}" style="width: {{video.source.player.progress}}%;"></div>
{% endif %}
</div> </div>
<div class="video-play"> <div class="video-play">
<img src="{% static 'img/icon-play.svg' %}" alt="play-icon"> <img src="{% static 'img/icon-play.svg' %}" alt="play-icon">

View File

@ -367,6 +367,7 @@ class ChannelIdView(ArchivistResultsView):
self.initiate_vars(request) self.initiate_vars(request)
self._update_view_data(channel_id) self._update_view_data(channel_id)
self.find_results() self.find_results()
self.match_progress()
if self.context["results"]: if self.context["results"]:
channel_info = self.context["results"][0]["source"]["channel"] channel_info = self.context["results"][0]["source"]["channel"]
@ -468,6 +469,7 @@ class PlaylistIdView(ArchivistResultsView):
playlist_name = playlist_info["playlist_name"] playlist_name = playlist_info["playlist_name"]
self._update_view_data(playlist_id, playlist_info) self._update_view_data(playlist_id, playlist_info)
self.find_results() self.find_results()
self.match_progress()
self.context.update( self.context.update(
{ {
"title": "Playlist: " + playlist_name, "title": "Playlist: " + playlist_name,