forked from MarseyWorld/MarseyWorld
fix WPD slowness
parent
d3179e69b4
commit
28dbe0d6ab
|
@ -320,7 +320,7 @@ def sanitize(sanitized, edit=False, limit_pings=0, showmore=True):
|
||||||
sanitized = sanitized.replace(i.group(0), htmlsource)
|
sanitized = sanitized.replace(i.group(0), htmlsource)
|
||||||
|
|
||||||
sanitized = video_sub_regex.sub(r'\1<video controls preload="metadata"><source src="\2"></video>', sanitized)
|
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:
|
if not edit:
|
||||||
for marsey in g.db.query(Marsey).filter(Marsey.name.in_(marseys_used)).all():
|
for marsey in g.db.query(Marsey).filter(Marsey.name.in_(marseys_used)).all():
|
||||||
|
|
|
@ -774,7 +774,7 @@
|
||||||
{% elif p.is_audio %}
|
{% elif p.is_audio %}
|
||||||
<div class="row no-gutters">
|
<div class="row no-gutters">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<audio controls preload="metadata" src="{{p.realurl(v)}}"></audio>
|
<audio controls preload="none" src="{{p.realurl(v)}}"></audio>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<pre></pre>
|
<pre></pre>
|
||||||
|
|
|
@ -372,13 +372,13 @@
|
||||||
</div>
|
</div>
|
||||||
{% elif p.is_video %}
|
{% 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">
|
<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)}}">
|
<source src="{{p.realurl(v)}}">
|
||||||
</video>
|
</video>
|
||||||
</div>
|
</div>
|
||||||
{% elif p.is_audio %}
|
{% 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">
|
<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>
|
</div>
|
||||||
{% elif p.is_youtube %}
|
{% 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">
|
<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">
|
||||||
|
|
Loading…
Reference in New Issue