fix WPD slowness

master
Aevann1 2022-09-03 05:34:06 +02:00
parent d3179e69b4
commit 28dbe0d6ab
3 changed files with 4 additions and 4 deletions

View File

@ -320,7 +320,7 @@ def sanitize(sanitized, edit=False, limit_pings=0, showmore=True):
sanitized = sanitized.replace(i.group(0), htmlsource)
sanitized = video_sub_regex.sub(r'\1<video controls preload="metadata"><source src="\2"></video>', sanitized)
sanitized = audio_sub_regex.sub(r'\1<audio controls preload="metadata" src="\2"></audio>', sanitized)
sanitized = audio_sub_regex.sub(r'\1<audio controls preload="none" src="\2"></audio>', sanitized)
if not edit:
for marsey in g.db.query(Marsey).filter(Marsey.name.in_(marseys_used)).all():

View File

@ -774,7 +774,7 @@
{% elif p.is_audio %}
<div class="row no-gutters">
<div class="col">
<audio controls preload="metadata" src="{{p.realurl(v)}}"></audio>
<audio controls preload="none" src="{{p.realurl(v)}}"></audio>
</div>
</div>
<pre></pre>

View File

@ -372,13 +372,13 @@
</div>
{% elif p.is_video %}
<div id="video-{{p.id}}" style="text-align: center" class="{% if p.over_18 or not ((v and v.cardview) or (not v and CARD_VIEW)) %}d-none{% endif %} mt-4">
<video id="video2-{{p.id}}" controls preload="metadata">
<video id="video2-{{p.id}}" controls preload="none">
<source src="{{p.realurl(v)}}">
</video>
</div>
{% elif p.is_audio %}
<div id="video-{{p.id}}" style="text-align: center" class="{% if p.over_18 or not ((v and v.cardview) or (not v and CARD_VIEW)) %}d-none{% endif %} mt-4">
<audio id="video2-{{p.id}}" controls preload="metadata" src="{{p.realurl(v)}}"></audio>
<audio id="video2-{{p.id}}" controls preload="none" src="{{p.realurl(v)}}"></audio>
</div>
{% elif p.is_youtube %}
<div id="video-{{p.id}}" class="{% if p.over_18 or not ((v and v.cardview) or (not v and CARD_VIEW)) %}d-none{% endif %} mt-3 mb-4 youtube_embed">