FIX podcast duration (hours)

This commit is contained in:
root 2019-11-26 10:28:07 +01:00
parent 91303a0b17
commit a8073b3537

View file

@ -24,7 +24,8 @@
{% set audiourl = audio.field_audio_link[0].uri %}
{% set ext = audiourl|split('.')|last %}
{% set durata = audio.field_durata[0].value %}
{% set duratamin = durata // 60 %}
{% set duratahrs = durata // 3600 %}
{% set duratamin = (durata // 60) % 60 %}
{% set duratasec = durata % 60 %}
{% if num_audios > 1 %}
<title> {{node.title.0.value}} ({{num+1}}/{{num_audios}}: {{audio.field_audio_link[0].title}}) </title>
@ -44,7 +45,7 @@
<enclosure url="{{ audiourl | replace({"https://": "http://"}) | escape('html_attr') }}" type="audio/{{ext}}" length="1024"></enclosure>
<pubDate>{{ "@#{node.created.0.value}" | date("r") }}</pubDate>
<itunes:author>Redazione Ondarossa</itunes:author>
<itunes:duration>00:{{"%02d" | format(duratamin)}}:{{"%02d" | format(duratasec)}}</itunes:duration>
<itunes:duration>{{"%02d" | format(duratahrs)}}:{{"%02d" | format(duratamin)}}:{{"%02d" | format(duratasec)}}</itunes:duration>
<itunes:explicit>no</itunes:explicit>
<guid>{{ audiourl }}</guid>
</item>