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.
This commit is contained in:
James Taylor
2019-12-21 15:45:01 -08:00
parent 3936310e7e
commit 7a6bcb6128
3 changed files with 48 additions and 47 deletions

View File

@@ -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>