selfhostable, read-only reddit client
16
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix thumbnails, sometimes

Akshay a0ed8623 622c5fee

+10 -1
+2 -1
src/mixins/post.pug
··· 25 25 - var item = postGalleryItems(p)[0] 26 26 img(src=item.url onclick=`toggleDetails('${p.id}')`) 27 27 else if isPostImage(p) 28 - img(src=p.thumbnail onclick=`toggleDetails('${p.id}')`) 28 + - var url = postThumbnail(p) 29 + img(src=url onclick=`toggleDetails('${p.id}')`) 29 30 else if isPostVideo(p) 30 31 - var url = p.secure_media.reddit_video.scrubber_media_url 31 32 video(src=url data-dashjs-player width='100px' height='100px' onclick=`toggleDetails('${p.id}')`)
+8
src/mixins/postUtils.pug
··· 7 7 return (p.post_hint == "image" && p.thumbnail && p.thumbnail != "self" && p.thumbnail != "default"); 8 8 } 9 9 - 10 + function postThumbnail(p) { 11 + if (p.thumbnail == "image") { 12 + return p.url 13 + } else { 14 + return p.thumbnail; 15 + } 16 + } 17 + - 10 18 function isPostVideo(p) { 11 19 return (p.post_hint == "hosted:video"); 12 20 }