File tree Expand file tree Collapse file tree 5 files changed +29
-14
lines changed Expand file tree Collapse file tree 5 files changed +29
-14
lines changed Original file line number Diff line number Diff line change 1+ ## 0.6.7
2+
3+ - Update example to handle null feed.
4+ - Default podcast image to take iTunes version if available and fallback to channel version to be consistent with episode image handling.
5+
16## 0.6.6
27
38- Minor bug fixes to the SRT parser.
Original file line number Diff line number Diff line change @@ -8,24 +8,30 @@ examples limit to 10 results and are set for the United Kingdom:
88``` dart
99import 'package:podcast_search/podcast_search.dart';
1010
11- main() async {
11+ // ignore_for_file: avoid_print
12+ void main() async {
1213 var search = Search();
1314
1415 /// Search for podcasts with 'widgets' in the title.
15- var results = await search.search('widgets', country: Country.unitedKingdom, limit: 10);
16+ var results =
17+ await search.search('widgets', country: Country.unitedKingdom, limit: 10);
1618
1719 /// List the name of each podcast found.
1820 for (var result in results.items) {
1921 print('Found podcast: ${result.trackName}');
2022 }
2123
2224 /// Parse the first podcast.
23- var podcast = await Podcast.loadFeed(url: results.items[0].feedUrl!) ;
25+ final feed = results.items[0].feedUrl;
2426
25- /// Display episode titles.
26- ///
27- for (var episode in podcast.episodes) {
28- print('Episode title: ${episode.title}');
27+ /// It is possible to get back a podcast with a missing feed URL, so check that.
28+ if (feed != null) {
29+ var podcast = await Podcast.loadFeed(url: feed);
30+
31+ /// Display episode titles.
32+ for (var episode in podcast.episodes) {
33+ print('Episode title: ${episode.title}');
34+ }
2935 }
3036
3137 /// Find the top 10 podcasts in the UK.
Original file line number Diff line number Diff line change @@ -17,12 +17,16 @@ void main() async {
1717 }
1818
1919 /// Parse the first podcast.
20- var podcast = await Podcast . loadFeed (url : results.items[0 ].feedUrl! ) ;
20+ final feed = results.items[0 ].feedUrl;
2121
22- /// Display episode titles.
23- ///
24- for (var episode in podcast.episodes) {
25- print ('Episode title: ${episode .title }' );
22+ /// It is possible to get back a podcast with a missing feed URL, so check that.
23+ if (feed != null ) {
24+ var podcast = await Podcast .loadFeed (url: feed);
25+
26+ /// Display episode titles.
27+ for (var episode in podcast.episodes) {
28+ print ('Episode title: ${episode .title }' );
29+ }
2630 }
2731
2832 /// Find the top 10 podcasts in the UK.
Original file line number Diff line number Diff line change @@ -245,7 +245,7 @@ class Podcast {
245245 link: rssFeed.link,
246246 title: rssFeed.title,
247247 description: rssFeed.description,
248- image: rssFeed.image? .url ?? rssFeed.itunes ? . image? .href ,
248+ image: rssFeed.itunes ? . image? .href ?? rssFeed.image? .url ,
249249 copyright: author,
250250 locked: locked,
251251 funding: funding,
Original file line number Diff line number Diff line change 11name : podcast_search
22description : A library for searching for podcasts and parsing podcast RSS feeds. Supports iTunes and PodcastIndex directories, and newer features such as chapters and transcripts.
33
4- version : 0.6.6
4+ version : 0.6.7
55homepage : https://github.com/amugofjava/podcast_search
66
77environment :
You can’t perform that action at this time.
0 commit comments