amugofjava / podcast_search

A simple library providing programmatic access to the iTunes search API for podcasts.
MIT License
41 stars 26 forks source link

Podcast fails to load if pubDate is not present on an item #11

Closed chrispolley closed 1 year ago

chrispolley commented 2 years ago

Hi, At line 295 of model/podcast.dart, you assert that item.pubDate is not null [assignment of Episode.publicationDate as Utils.parseRFC2822Date(item.pubDate!),], but the specification indicates that "\<pubDate> is an optional sub-element of \<item>." See https://validator.w3.org/feed/docs/rss2.html#hrelementsOfLtitemgt

https://github.com/amugofjava/podcast_search/blob/026b5b7c54b7c24934f7941feae44ad342c9317d/lib/src/model/podcast.dart#L295

When the code encounters this, it throws an exception when pubDate is not present on an item.

The feeds I am having trouble with publish a DublinCore dc:date field for each item, and the W3C RSS validator recommends that a feed only include one of dc:date and pubDate, since there is no official precedence between the fields.

Thanks!

amugofjava commented 2 years ago

Thank you for raising this.

amugofjava commented 1 year ago

Hi @chrispolley,

I am catching up on a few issues. Could you please let me know which podcast you are referring to in your issue to help me reproduce? Thanks.

amugofjava commented 1 year ago

Fixed in latest master.