mirror of
https://github.com/tubearchivist/tubearchivist-frontend.git
synced 2024-12-22 18:00:17 +00:00
fix missing average_rating due to lack of dislikes
This commit is contained in:
parent
7924f28ccb
commit
53f93a7bb9
@ -55,7 +55,9 @@
|
||||
<div>
|
||||
<p>Views: {{ video.stats.view_count|intcomma }}</p>
|
||||
<p class="thumb-icon like"><img src="{% static 'img/icon-thumb.svg' %}" alt="thumbs-up">: {{ video.stats.like_count|intcomma }}</p>
|
||||
<p class="thumb-icon dislike"><img src="{% static 'img/icon-thumb.svg' %}" alt="thumbs-down">: {{ video.stats.dislike_count|intcomma }}</p>
|
||||
{% if video.stats.dislike_count %}
|
||||
<p class="thumb-icon dislike"><img src="{% static 'img/icon-thumb.svg' %}" alt="thumbs-down">: {{ video.stats.dislike_count|intcomma }}</p>
|
||||
{% endif %}
|
||||
{% if video.stats.average_rating %}
|
||||
<p class="rating-stars">Rating:
|
||||
{% for star in video.stats.average_rating %}
|
||||
|
@ -875,6 +875,9 @@ class VideoView(View):
|
||||
@staticmethod
|
||||
def star_creator(rating):
|
||||
"""convert rating float to stars"""
|
||||
if not rating:
|
||||
return False
|
||||
|
||||
stars = []
|
||||
for _ in range(1, 6):
|
||||
if rating >= 0.75:
|
||||
|
Loading…
Reference in New Issue
Block a user