add podcast length data file; add length argument to enclosures dynamically

This commit is contained in:
Greg Gauthier 2022-01-07 21:28:06 +00:00
parent a5c0016f54
commit 9ca6b2dcc5
3 changed files with 174 additions and 127 deletions

164
data/podcasts.json Normal file
View File

@ -0,0 +1,164 @@
{
"podcasts": [
{
"filename": "audio/podcast_2020-02-14_ddc9c314bfb1765b223a935cf80471a7.mp3",
"filesize": "34903034"
},
{
"filename": "audio/podcast_2020-02-15_119b0ae00c253dcd57b1e52f89879a9c.mp3",
"filesize": "20748544"
},
{
"filename": "audio/podcast_2020-02-15_ec2e429cc1ec06e965e509426bb3d836.mp3",
"filesize": "1987770"
},
{
"filename": "audio/podcast_2020-02-17_5d73a5c13752bfa50890b8854fe2269d.mp3",
"filesize": "32653395"
},
{
"filename": "audio/podcast_2020-02-17_c2676aeb7b7eb0e7b4993fdc00899ef0.mp3",
"filesize": "29901157"
},
{
"filename": "audio/podcast_2020-02-21_3714fa981ba37d0f6f8a2478612bd2c6.mp3",
"filesize": "20303373"
},
{
"filename": "audio/podcast_2020-02-27_8cec687245f86d0ab10bbe975c356f09.mp3",
"filesize": "12426619"
},
{
"filename": "audio/podcast_2020-02-28_f8d982f11c04cf7105a0ec21597da316.mp3",
"filesize": "92848710"
},
{
"filename": "audio/podcast_2020-03-16_300800f3e7dcf7e496c3a27864bd1d6f.mp3",
"filesize": "18303039"
},
{
"filename": "audio/podcast_2020-04-04_boethius-book-1-chapter-1-and-2.mp3",
"filesize": "46446954"
},
{
"filename": "audio/podcast_2020-04-19_boethius-book-1-chapter-3.mp3",
"filesize": "27167535"
},
{
"filename": "audio/podcast_2020-05-02_boethius-book-1-chapter-4.mp3",
"filesize": "52132237"
},
{
"filename": "audio/podcast_2020-05-02_boethius-book-1-chapter-5.mp3",
"filesize": "34050277"
},
{
"filename": "audio/podcast_2020-05-02_boethius-book-1-chapter-6-and-7.mp3",
"filesize": "37298871"
},
{
"filename": "audio/podcast_2020-05-03_boethius-book-2-chapter-1.mp3",
"filesize": "35793167"
},
{
"filename": "audio/podcast_2020-05-10_boethius-book-2-chapter-2.mp3",
"filesize": "33335567"
},
{
"filename": "audio/podcast_2020-05-18_boethius-book-2-chapter-3.mp3",
"filesize": "22340106"
},
{
"filename": "audio/podcast_2020-05-24_boethius-book-2-chapter-4.mp3",
"filesize": "61680514"
},
{
"filename": "audio/podcast_2020-05-31_boethius-book-2-chapter-5.mp3",
"filesize": "62352372"
},
{
"filename": "audio/podcast_2020-06-07_boethius-book-2-chapter-6.mp3",
"filesize": "35179800"
},
{
"filename": "audio/podcast_2020-06-14_boethius-addendum-the-music-of-the-consolation.mp3",
"filesize": "49386257"
},
{
"filename": "audio/podcast_2020-06-19_boethius-book-2-chapter-7.mp3",
"filesize": "56283604"
},
{
"filename": "audio/podcast_2020-06-28_boethius-book-2-chapter-8.mp3",
"filesize": "34514200"
},
{
"filename": "audio/podcast_2020-07-05_boethius-book-3-chapter-1.mp3",
"filesize": "27630412"
},
{
"filename": "audio/podcast_2020-07-12_boethius-book-3-chapter-2.mp3",
"filesize": "50721612"
},
{
"filename": "audio/podcast_2020-07-19_boethius-book-3-chapter-3.mp3",
"filesize": "28661727"
},
{
"filename": "audio/podcast_2020-09-12_boethius-book-3-chapter-4.mp3",
"filesize": "28811147"
},
{
"filename": "audio/podcast_2020-09-20_boethius-book-3-chapter-5.mp3",
"filesize": "37170331"
},
{
"filename": "audio/podcast_2020-09-27_boethius-book-3-chapter-6.mp3",
"filesize": "41591294"
},
{
"filename": "audio/podcast_2020-10-04_boethius-book-3-chapter-7.mp3",
"filesize": "46439621"
},
{
"filename": "audio/podcast_2020-10-06_867b86fbd34ba9bd87dd8d13376bd27b.mp3",
"filesize": "48145801"
},
{
"filename": "audio/podcast_2020-10-11_boethius-book-3-chapter-8.mp3",
"filesize": "18848045"
},
{
"filename": "audio/podcast_2020-10-18_boethius-book-3-chapter-9.mp3",
"filesize": "52823947"
},
{
"filename": "audio/podcast_2020-10-25_boethius-book-3-chapter-10.mp3",
"filesize": "90380715"
},
{
"filename": "audio/podcast_2020-11-09_boethius-addendum-who-is-lady-philosophy.mp3",
"filesize": "47531556"
},
{
"filename": "audio/podcast_2020-11-09_boethius-book-3-chapter-11.mp3",
"filesize": "73180650"
},
{
"filename": "audio/podcast_2020-11-14_boethius-book-3-chapter-12.mp3",
"filesize": "65197630"
},
{
"filename": "audio/podcast_2020-11-22_boethius-book-4-chapter-1.mp3",
"filesize": "21783163"
},
{
"filename": "audio/podcast_2020-12-06_boethius-book-4-chapter-2.mp3",
"filesize": "70762755"
},
{
"filename": "audio/podcast_2020-12-22_boethius-book-4-chapter-3.mp3",
"filesize": "33078510"
}
]
}

View File

@ -1,124 +0,0 @@
{
"podcasts": [
{
"audio/podcast_2020-02-14_ddc9c314bfb1765b223a935cf80471a7.mp3": "34903034"
},
{
"audio/podcast_2020-02-15_119b0ae00c253dcd57b1e52f89879a9c.mp3": "20748544"
},
{
"audio/podcast_2020-02-15_ec2e429cc1ec06e965e509426bb3d836.mp3": "1987770"
},
{
"audio/podcast_2020-02-17_5d73a5c13752bfa50890b8854fe2269d.mp3": "32653395"
},
{
"audio/podcast_2020-02-17_c2676aeb7b7eb0e7b4993fdc00899ef0.mp3": "29901157"
},
{
"audio/podcast_2020-02-21_3714fa981ba37d0f6f8a2478612bd2c6.mp3": "20303373"
},
{
"audio/podcast_2020-02-27_8cec687245f86d0ab10bbe975c356f09.mp3": "12426619"
},
{
"audio/podcast_2020-02-28_f8d982f11c04cf7105a0ec21597da316.mp3": "92848710"
},
{
"audio/podcast_2020-03-16_300800f3e7dcf7e496c3a27864bd1d6f.mp3": "18303039"
},
{
"audio/podcast_2020-04-04_boethius-book-1-chapter-1-and-2.mp3": "46446954"
},
{
"audio/podcast_2020-04-19_boethius-book-1-chapter-3.mp3": "27167535"
},
{
"audio/podcast_2020-05-02_boethius-book-1-chapter-4.mp3": "52132237"
},
{
"audio/podcast_2020-05-02_boethius-book-1-chapter-5.mp3": "34050277"
},
{
"audio/podcast_2020-05-02_boethius-book-1-chapter-6-and-7.mp3": "37298871"
},
{
"audio/podcast_2020-05-03_boethius-book-2-chapter-1.mp3": "35793167"
},
{
"audio/podcast_2020-05-10_boethius-book-2-chapter-2.mp3": "33335567"
},
{
"audio/podcast_2020-05-18_boethius-book-2-chapter-3.mp3": "22340106"
},
{
"audio/podcast_2020-05-24_boethius-book-2-chapter-4.mp3": "61680514"
},
{
"audio/podcast_2020-05-31_boethius-book-2-chapter-5.mp3": "62352372"
},
{
"audio/podcast_2020-06-07_boethius-book-2-chapter-6.mp3": "35179800"
},
{
"audio/podcast_2020-06-14_boethius-addendum-the-music-of-the-consolation.mp3": "49386257"
},
{
"audio/podcast_2020-06-19_boethius-book-2-chapter-7.mp3": "56283604"
},
{
"audio/podcast_2020-06-28_boethius-book-2-chapter-8.mp3": "34514200"
},
{
"audio/podcast_2020-07-05_boethius-book-3-chapter-1.mp3": "27630412"
},
{
"audio/podcast_2020-07-12_boethius-book-3-chapter-2.mp3": "50721612"
},
{
"audio/podcast_2020-07-19_boethius-book-3-chapter-3.mp3": "28661727"
},
{
"audio/podcast_2020-09-12_boethius-book-3-chapter-4.mp3": "28811147"
},
{
"audio/podcast_2020-09-20_boethius-book-3-chapter-5.mp3": "37170331"
},
{
"audio/podcast_2020-09-27_boethius-book-3-chapter-6.mp3": "41591294"
},
{
"audio/podcast_2020-10-04_boethius-book-3-chapter-7.mp3": "46439621"
},
{
"audio/podcast_2020-10-06_867b86fbd34ba9bd87dd8d13376bd27b.mp3": "48145801"
},
{
"audio/podcast_2020-10-11_boethius-book-3-chapter-8.mp3": "18848045"
},
{
"audio/podcast_2020-10-18_boethius-book-3-chapter-9.mp3": "52823947"
},
{
"audio/podcast_2020-10-25_boethius-book-3-chapter-10.mp3": "90380715"
},
{
"audio/podcast_2020-11-09_boethius-addendum-who-is-lady-philosophy.mp3": "47531556"
},
{
"audio/podcast_2020-11-09_boethius-book-3-chapter-11.mp3": "73180650"
},
{
"audio/podcast_2020-11-14_boethius-book-3-chapter-12.mp3": "65197630"
},
{
"audio/podcast_2020-11-22_boethius-book-4-chapter-1.mp3": "21783163"
},
{
"audio/podcast_2020-12-06_boethius-book-4-chapter-2.mp3": "70762755"
},
{
"audio/podcast_2020-12-22_boethius-book-4-chapter-3.mp3": "33078510"
}
]
}

View File

@ -56,10 +56,17 @@
<itunes:image href="{{.Site.Params.podcastCdnURL }}{{ with .Params.image }}{{.}}{{ end }}"/> <itunes:image href="{{.Site.Params.podcastCdnURL }}{{ with .Params.image }}{{.}}{{ end }}"/>
{{ if isset .Params "enclosure" }} {{ if isset .Params "enclosure" }}
{{ with .Params.enclosure }} {{ $enclosure := .Params.enclosure }}
<enclosure url="{{ $.Site.Params.podcastCdnURL }}{{ . }}" type="audio/mpeg"/> {{ $scratch := newScratch }}
{{ end }} {{ range $.Site.Data.podcasts.podcasts }}
{{ if eq .filename $enclosure }}
{{ $scratch.Set "filesize" .filesize }}
{{ end }}
{{ end}}
{{ $filesize := $scratch.Get "filesize" }}
<enclosure url="{{ $.Site.Params.podcastCdnURL }}{{ $enclosure }}" type="audio/mpeg" length="{{ $filesize }}"/>
{{ end }} {{ end }}
<description> <description>
{{`<![CDATA[ ` | safeHTML }} {{`<![CDATA[ ` | safeHTML }}
{{ if isset .Params "image" }}<img src="{{ .Site.Params.podcastCdnURL }}{{ with .Params.image }}{{.}}{{ end }}" width="600" height="338" />{{end}} {{ if isset .Params "image" }}<img src="{{ .Site.Params.podcastCdnURL }}{{ with .Params.image }}{{.}}{{ end }}" width="600" height="338" />{{end}}