aboutsummaryrefslogtreecommitdiffstats
path: root/youtube/templates
diff options
context:
space:
mode:
authorJames Taylor <user234683@users.noreply.github.com>2019-12-21 15:45:01 -0800
committerJames Taylor <user234683@users.noreply.github.com>2019-12-21 15:45:01 -0800
commit7a6bcb6128ff6263cdfc2e215690fb6ffc33df17 (patch)
tree36e591a801f781f1b154d912e74f29c5a2890bc2 /youtube/templates
parent3936310e7e9bbd5194bc07403f775c4a50dfb16b (diff)
downloadyt-local-7a6bcb6128ff6263cdfc2e215690fb6ffc33df17.tar.lz
yt-local-7a6bcb6128ff6263cdfc2e215690fb6ffc33df17.tar.xz
yt-local-7a6bcb6128ff6263cdfc2e215690fb6ffc33df17.zip
Rewrite channel extraction with proper error handling and new extraction names. Extract subscriber_count correctly.
Don't just shove english strings into info['stats']. Actually give semantic names for the stats.
Diffstat (limited to 'youtube/templates')
-rw-r--r--youtube/templates/channel.html10
1 files changed, 8 insertions, 2 deletions
diff --git a/youtube/templates/channel.html b/youtube/templates/channel.html
index 48041a0..d99af9e 100644
--- a/youtube/templates/channel.html
+++ b/youtube/templates/channel.html
@@ -116,8 +116,14 @@
{% if current_tab == 'about' %}
<div class="channel-info">
<ul>
- {% for stat in stats %}
- <li>{{ stat }}</li>
+ {% for (before_text, stat, after_text) in [
+ ('Joined ', date_joined, ''),
+ ('', view_count|commatize, ' views'),
+ ('', approx_subscriber_count, ' subscribers'),
+ ] %}
+ {% if stat %}
+ <li>{{ before_text + stat|string + after_text }}</li>
+ {% endif %}
{% endfor %}
</ul>
<hr>