diff options
author | James Taylor <user234683@users.noreply.github.com> | 2019-12-21 15:45:01 -0800 |
---|---|---|
committer | James Taylor <user234683@users.noreply.github.com> | 2019-12-21 15:45:01 -0800 |
commit | 7a6bcb6128ff6263cdfc2e215690fb6ffc33df17 (patch) | |
tree | 36e591a801f781f1b154d912e74f29c5a2890bc2 /youtube/templates/channel.html | |
parent | 3936310e7e9bbd5194bc07403f775c4a50dfb16b (diff) | |
download | yt-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/channel.html')
-rw-r--r-- | youtube/templates/channel.html | 10 |
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> |