mirror of
https://github.com/tubearchivist/tubearchivist-frontend.git
synced 2024-11-22 20:00:15 +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>
|
<div>
|
||||||
<p>Views: {{ video.stats.view_count|intcomma }}</p>
|
<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 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 %}
|
{% if video.stats.average_rating %}
|
||||||
<p class="rating-stars">Rating:
|
<p class="rating-stars">Rating:
|
||||||
{% for star in video.stats.average_rating %}
|
{% for star in video.stats.average_rating %}
|
||||||
|
@ -875,6 +875,9 @@ class VideoView(View):
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def star_creator(rating):
|
def star_creator(rating):
|
||||||
"""convert rating float to stars"""
|
"""convert rating float to stars"""
|
||||||
|
if not rating:
|
||||||
|
return False
|
||||||
|
|
||||||
stars = []
|
stars = []
|
||||||
for _ in range(1, 6):
|
for _ in range(1, 6):
|
||||||
if rating >= 0.75:
|
if rating >= 0.75:
|
||||||
|
Loading…
Reference in New Issue
Block a user