diff --git a/lib/src/model/item.dart b/lib/src/model/item.dart index 4ea89a8..dd6abf5 100644 --- a/lib/src/model/item.dart +++ b/lib/src/model/item.dart @@ -83,6 +83,9 @@ class Item { /// Full list of genres for the podcast. final List? genre; + // Channel level description. + final String? description; + Item({ this.artistId, this.collectionId, @@ -110,6 +113,7 @@ class Item { this.primaryGenreName, this.contentAdvisoryRating, this.genre, + this.description, }); /// Takes our json map and builds a Podcast instance from it. @@ -179,6 +183,7 @@ class Item { artworkUrl: json['image'] as String?, genre: genres, releaseDate: DateTime.fromMillisecondsSinceEpoch(pubDate.inMilliseconds), + description: json['description'] as String?, ); } diff --git a/test/podcast_search_test.dart b/test/podcast_search_test.dart index 6789965..71d416d 100644 --- a/test/podcast_search_test.dart +++ b/test/podcast_search_test.dart @@ -10,8 +10,9 @@ void main() { setUp(() { search = Search( - searchProvider: - PodcastIndexProvider(key: 'XXWQEGULBJABVHZUM8NF', secret: 'KZ2uy4upvq4t3e\$m\$3r2TeFS2fEpFTAaF92xcNdX'), + searchProvider: PodcastIndexProvider( + key: 'XXWQEGULBJABVHZUM8NF', + secret: 'KZ2uy4upvq4t3e\$m\$3r2TeFS2fEpFTAaF92xcNdX'), ); }); @@ -21,6 +22,20 @@ void main() { expect(result.resultCount > 0, true); }); + test('Podcast description', () async { + final result = await search.search('The Rest Is History'); + + final item = result.items.firstWhere( + (element) => + element.trackName + ?.toLowerCase() + .contains('the rest is history') ?? + false, + orElse: null); + expect(item, isNotNull); + expect(item.description, isNotNull); + }); + test('Max one result test', () async { final result = await search.search('Forest 404');