Cache profiles

This commit is contained in:
Zed
2019-06-20 20:04:18 +02:00
parent 63d7528b8f
commit 6103db6893
8 changed files with 78 additions and 100 deletions

View File

@@ -3,9 +3,9 @@
#import ../types, ../formatters, ../utils
#
#proc renderHeading(tweet: Tweet): string =
#if tweet.retweetBy != "":
#if tweet.retweetBy.isSome:
<div class="retweet">
<span>🔄 ${tweet.retweetBy} retweeted</span>
<span>🔄 ${tweet.retweetBy.get()} retweeted</span>
</div>
#end if
#if tweet.pinned:
@@ -59,7 +59,7 @@
<div class="attachments media-body">
<div class="gallery-row" style="max-height: unset;">
<div class="attachment image">
<video poster=${tweet.videoThumb} style="width: 100%; height: 100%;" autoplay muted loop></video>
<video poster=${tweet.videoThumb.get()} style="width: 100%; height: 100%;" autoplay muted loop></video>
<div class="video-overlay">
<p>Video playback not supported</p>
</div>
@@ -102,9 +102,9 @@
</div>
#if tweet.photos.len > 0:
${renderMediaGroup(tweet)}
#elif tweet.videoThumb.len > 0:
#elif tweet.videoThumb.isSome:
${renderVideo(tweet)}
#elif tweet.gif.len > 0:
#elif tweet.gif.isSome:
${renderGif(tweet)}
#end if
${renderStats(tweet)}

View File

@@ -73,7 +73,7 @@
#for tweet in tweets:
#if tweet in retweets: continue
#end if
#if tweet.retweetBy.len > 0: retweets.add tweet
#if tweet.retweetBy.isSome: retweets.add tweet
#end if
${renderTweet(tweet, "timeline-tweet")}
#end for