Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/src/model/item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ class Item {
/// Full list of genres for the podcast.
final List<Genre>? genre;

// Channel level description.
final String? description;

Item({
this.artistId,
this.collectionId,
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -179,6 +183,7 @@ class Item {
artworkUrl: json['image'] as String?,
genre: genres,
releaseDate: DateTime.fromMillisecondsSinceEpoch(pubDate.inMilliseconds),
description: json['description'] as String?,
);
}

Expand Down
19 changes: 17 additions & 2 deletions test/podcast_search_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
);
});

Expand All @@ -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');

Expand Down