diff options
author | Jesús <heckyel@hyperbola.info> | 2022-01-31 22:36:54 -0500 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2022-01-31 22:36:54 -0500 |
commit | fef9c778eda99060893ef0575f8e6944ed77e038 (patch) | |
tree | 49424b4e2d889fe4f5bf5ceca3a82c6d2a83f4ad /youtube | |
parent | 6188ba81a099f31f7f1ca5d374e8b3c4175fb933 (diff) | |
download | yt-local-fef9c778eda99060893ef0575f8e6944ed77e038.tar.lz yt-local-fef9c778eda99060893ef0575f8e6944ed77e038.tar.xz yt-local-fef9c778eda99060893ef0575f8e6944ed77e038.zip |
check variable author_description
Diffstat (limited to 'youtube')
-rw-r--r-- | youtube/templates/common_elements.html | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/youtube/templates/common_elements.html b/youtube/templates/common_elements.html index 11b04a2..bacc513 100644 --- a/youtube/templates/common_elements.html +++ b/youtube/templates/common_elements.html @@ -40,11 +40,13 @@ {% if include_author %} {% set author_description = info['author'] %} {% set AUTHOR_DESC_LENGTH = 35 %} - {% if author_description|length >= AUTHOR_DESC_LENGTH %} - {% set author_description = author_description[:AUTHOR_DESC_LENGTH].split(' ')[:-1]|join(' ') %} - {% if not author_description[-1] in ['.', '?', ':', '!'] %} - {% set author_more = author_description + '…' %} - {% set author_description = author_more|replace('"','') %} + {% if author_description != None %} + {% if author_description|length >= AUTHOR_DESC_LENGTH %} + {% set author_description = author_description[:AUTHOR_DESC_LENGTH].split(' ')[:-1]|join(' ') %} + {% if not author_description[-1] in ['.', '?', ':', '!'] %} + {% set author_more = author_description + '…' %} + {% set author_description = author_more|replace('"','') %} + {% endif %} {% endif %} {% endif %} {% if info.get('author_url') %} |