Fix setting of RSS feed enclosures mime-type

Mime-type does not always match file extension.
This commit is contained in:
Roan Horning 2022-08-17 19:16:22 -04:00
parent 41a18300eb
commit 83c188465d
Signed by untrusted user: rho_n
GPG Key ID: 234AEF20B72D5769
2 changed files with 7 additions and 4 deletions

View File

@ -1,5 +1,5 @@
<!--% PROCESS 'shared-item.tpl.xml' %-->
<!--% PROCESS 'rss-query-hpr.tpl.xml' %-->
<!--% FOREACH episode IN feed_result %-->
<!--% display_item(episode, 'mp3') %-->
<!--% display_item(episode, 'mp3', 'mpeg') %-->
<!--% END %-->

View File

@ -1,5 +1,8 @@
<!--% PROCESS 'shared-utils.tpl.html' %-->
<!--% MACRO display_item(episode, media_type) BLOCK %-->
<!--% MACRO display_item(episode, file_extension, audio_mime_type) BLOCK %-->
<!--% IF audio_mime_type == "" %-->
<!--% audio_mime_type = 'ogg' %-->
<!--% END %-->
<item>
<itunes:explicit><!--% display_explicit_feed(episode.explicit) %--></itunes:explicit>
<googleplay:explicit><!--% display_explicit_feed(episode.explicit) %--></googleplay:explicit>
@ -14,7 +17,7 @@
<itunes:summary><![CDATA[<!--% episode.notes %-->]]>
</itunes:summary>
<pubDate><!--% format_feed_date(episode.date) %--></pubDate>
<enclosure url="http://hackerpublicradio.org/eps/hpr<!--% zero_pad_left(episode.id) %-->.<!--% media_type %-->" length="<!--% episode.duration * 1000 %-->" type="audio/<!--% media_type %-->"/>
<guid>http://hackerpublicradio.org/eps/hpr<!--% zero_pad_left(episode.id) %-->.<!--% media_type %--></guid>
<enclosure url="http://hackerpublicradio.org/eps/hpr<!--% zero_pad_left(episode.id) %-->.<!--% file_extension %-->" length="<!--% episode.duration * 1000 %-->" type="audio/<!--% audio_mime_type %-->"/>
<guid>http://hackerpublicradio.org/eps/hpr<!--% zero_pad_left(episode.id) %-->.<!--% file_extension %--></guid>
</item>
<!--% END %-->