@@ -194,6 +194,7 @@ <h1 class="post_title">
194
194
{% endmacro %}
195
195
196
196
{% macro post_in_list(post) -%}
197
+ {% set post_should_be_blurred = (post.flags.nsfw && prefs.blur_nsfw=="on") || (post.flags.spoiler && prefs.blur_spoiler=="on") -%}
197
198
< div class ="post {% if post.flags.stickied %}stickied{% endif %} " id ="{{ post.id }} ">
198
199
< p class ="post_header ">
199
200
{% let community -%}
@@ -233,7 +234,7 @@ <h2 class="post_title">
233
234
< img width ="100% " height ="100% " loading ="lazy " alt ="Post image " src ="{{ post.media.url }} "/>
234
235
{% else %}
235
236
< svg
236
- {%if post.flags.nsfw && prefs.blur_nsfw ==" on " %}class ="post_nsfw_blur "{% endif %}
237
+ {%if post_should_be_blurred %}class ="post_nsfw_blur "{% endif %}
237
238
width ="{{ post.media.width }}px "
238
239
height ="{{ post.media.height }}px "
239
240
xmlns ="http://www.w3.org/2000/svg ">
@@ -247,19 +248,19 @@ <h2 class="post_title">
247
248
</ div >
248
249
{% else if (prefs.layout.is_empty() || prefs.layout == "card") && post.post_type == "gif" %}
249
250
< div class ="post_media_content ">
250
- < video class ="post_media_video short {%if post.flags.nsfw && prefs.blur_nsfw== " on " %}post_nsfw_blur{% endif %}" src="{{ post.media.url }} " {% if post.media.width > 0 && post.media.height > 0 %}width="{{ post.media.width }}" height="{{ post.media.height }}"{% endif %} poster="{{ post.media.poster }}" preload="none" controls loop {% if prefs.autoplay_videos == "on" %}autoplay{% endif %}> < a href ={{ post.media.url }} > Video</ a > </ video >
251
+ < video class ="post_media_video short {%if post_should_be_blurred %}post_nsfw_blur{% endif %} " src ="{{ post.media.url }} " {% if post.media.width > 0 && post.media.height > 0 %}width="{{ post.media.width }}" height="{{ post.media.height }}"{% endif %} poster="{{ post.media.poster }}" preload="none" controls loop {% if prefs.autoplay_videos == "on" %}autoplay{% endif %}> < a href ={{ post.media.url }} > Video</ a > </ video >
251
252
</ div >
252
253
{% else if (prefs.layout.is_empty() || prefs.layout == "card") && post.post_type == "video" %}
253
254
{% if prefs.use_hls == "on" && !post.media.alt_url.is_empty() %}
254
255
< div class ="post_media_content ">
255
- < video class ="post_media_video short {%if post.flags.nsfw && prefs.blur_nsfw== " on " %}post_nsfw_blur{% endif %} {% if prefs.autoplay_videos == "on " %}hls_autoplay{% endif %} " {% if post.media.width > 0 && post.media.height > 0 %}width="{{ post.media.width }}" height="{{ post.media.height }}"{% endif %} poster="{{ post.media.poster }}" controls preload="none">
256
+ < video class ="post_media_video short {%if post_should_be_blurred %}post_nsfw_blur{% endif %} {% if prefs.autoplay_videos == "on " %}hls_autoplay{% endif %}" {% if post.media.width > 0 && post.media.height > 0 %}width="{{ post.media.width }}" height="{{ post.media.height }}"{% endif %} poster="{{ post.media.poster }}" controls preload="none">
256
257
< source src ="{{ post.media.alt_url }} " type ="application/vnd.apple.mpegurl " />
257
258
< source src ="{{ post.media.url }} " type ="video/mp4 " />
258
259
</ video >
259
260
</ div >
260
261
{% else %}
261
262
< div class ="post_media_content ">
262
- < video class ="post_media_video short {%if post.flags.nsfw && prefs.blur_nsfw== " on " %}post_nsfw_blur{% endif %}" src="{{ post.media.url }} " {% if post.media.width > 0 && post.media.height > 0 %}width="{{ post.media.width }}" height="{{ post.media.height }}"{% endif %} poster="{{ post.media.poster }}" preload="none" controls {% if prefs.autoplay_videos == "on" %}autoplay{% endif %}> < a href ={{ post.media.url }} > Video</ a > </ video >
263
+ < video class ="post_media_video short {%if post_should_be_blurred %}post_nsfw_blur{% endif %} " src ="{{ post.media.url }} " {% if post.media.width > 0 && post.media.height > 0 %}width="{{ post.media.width }}" height="{{ post.media.height }}"{% endif %} poster="{{ post.media.poster }}" preload="none" controls {% if prefs.autoplay_videos == "on" %}autoplay{% endif %}> < a href ={{ post.media.url }} > Video</ a > </ video >
263
264
</ div >
264
265
{% call render_hls_notification(format!("{}%23{}", &self.url[1..].replace("&", "%26").replace("+", "%2B"), post.id)) %}
265
266
{% endif %}
@@ -272,7 +273,7 @@ <h2 class="post_title">
272
273
</ svg >
273
274
{% else %}
274
275
< div style ="max-width:{{ post.thumbnail.width }}px;max-height:{{ post.thumbnail.height }}px; ">
275
- < svg {% if post.flags.nsfw && prefs.blur_nsfw ==" on " %} class ="thumb_nsfw_blur " {% endif %} width ="{{ post.thumbnail.width }}px " height ="{{ post.thumbnail.height }}px " xmlns ="http://www.w3.org/2000/svg ">
276
+ < svg {% if post_should_be_blurred %} class ="thumb_nsfw_blur " {% endif %} width ="{{ post.thumbnail.width }}px " height ="{{ post.thumbnail.height }}px " xmlns ="http://www.w3.org/2000/svg ">
276
277
< image width ="100% " height ="100% " href ="{{ post.thumbnail.url }} "/>
277
278
< desc >
278
279
< img loading ="lazy " alt ="Thumbnail " src ="{{ post.thumbnail.url }} "/>
0 commit comments