Closed SamTV12345 closed 1 year ago
This is a bug report not a asking for help. Take this example:
fn main() {
let itunes_extention = ITunesChannelExtensionBuilder::default().author(Some("author".to_string()))
.build();
// create a rss channel
let channel = rss::ChannelBuilder::default()
.title("Channel Title")
.link("http://example.com")
.description("Channel Description")
.itunes_ext(itunes_extention)
.build();
println!("{}",channel.to_string())
}
Which generates this:
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Channel Title</title>
<link>http://example.com</link>
<description>Channel Description</description>
<itunes:author>author</itunes:author></channel>
</rss>
This errors in every browser because the itunes namespace is missing. This is equivalent to having an empty items vector.
This is tested on 2.0.2 and 2.0.3 which is the latest version.
@SamTV12345 Thanks for reporting. That's actually a nasty bug.
Sure no problem. A user of my app discovered that as he set the downloaded podcasts to 0 (I only display downloaded podcasts in the RSS feed). Now I'm always checking if the items is 0 then I don't include the itunes author etc.
A fix is released in 2.0.4
Thanks for the quick fix.
I get an invalid RSS feed when I try to create an RSS feed that has the itunes author set but has no items. This is because in the rss tag no itunes extension is defined. It seems that adding that namespace is solely dependent from the added items.
If no items exist it still adds itunes author etc. but fails to add the namespace.
Reproduction