endkb / SoundsDownloadScript

Download programs from BBC Sounds and publish them to a podcast feed
2 stars 0 forks source link

Add support for subcategories #26

Closed endkb closed 2 months ago

endkb commented 2 months ago

Subcategories should look like this:

<itunes:category text="Comedy">
    <itunes:subcategory text="Satire"/>
    <itunes:subcategory text="Stand-Up"/>
</itunes:category>

https://podcasters.apple.com/support/1691-apple-podcasts-categories

endkb commented 2 months ago

Rewrote the routine that reads the category field from the profile. It still splits the values at commas and puts them into an array, but it also now reads each value in the array and looks for a greater than (>) sign and splits that into an array as well. From there, the first value becomes the category and everything following becomes a subcategory of that.

CATEGORY=Category 1>Subcategory 1.1>Subcategory 1.2,Category 2>Subcategory 2.1

Becomes

<itunes:category text="Category 1">
    <itunes:category text="Subcategory 1.1"/>
    <itunes:category text="Subcategory 1.2"/>
</itunes:category>
<itunes:category text="Category 2">
    <itunes:category text="Subcategory 2.1"/>
</itunes:category>