Skip to content

Commit

Permalink
Add support for Podcasting 2.0 GUID tag.
Browse files Browse the repository at this point in the history
  • Loading branch information
amugofjava committed Jul 27, 2023
1 parent e0d03bc commit bfaad1d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.6.2

- Add support for Podcasting 2.0 GUID tag.

## 0.6.1

- Publication date is now optional.
Expand Down
8 changes: 8 additions & 0 deletions lib/src/model/podcast.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ import 'package:podcast_search/src/utils/utils.dart';
/// This class represents a podcast and its episodes. The Podcast is instantiated with a feed URL which is
/// then parsed and the episode list generated.
class Podcast {
/// The Podcasting 2.0 GUID value (optional).
/// https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md#guid
final String? guid;

/// The URL of the podcast. Contained within the enclosure RSS tag.
final String? url;

Expand Down Expand Up @@ -53,6 +57,7 @@ class Podcast {
final List<Episode> episodes;

Podcast._({
this.guid,
this.url,
this.link,
this.title,
Expand Down Expand Up @@ -161,6 +166,8 @@ class Podcast {
var funding = <Funding>[];
var persons = <Person>[];

var guid = rssFeed.podcastIndex?.guid;

if (rssFeed.podcastIndex != null) {
if (rssFeed.podcastIndex!.funding != null) {
for (var f in rssFeed.podcastIndex!.funding!) {
Expand All @@ -186,6 +193,7 @@ class Podcast {
_loadEpisodes(rssFeed, episodes);

return Podcast._(
guid: guid,
url: url,
link: rssFeed.link,
title: rssFeed.title,
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: podcast_search
description: A library for searching for podcasts, parsing podcast RSS feeds and obtaining episodes details. Supports searching via iTunes and PodcastIndex (preview).

version: 0.6.1
version: 0.6.2
homepage: https://github.com/amugofjava/podcast_search

environment:
Expand All @@ -12,7 +12,7 @@ dependencies:
convert: ^3.0.1
crypto: ^3.0.1
dio: ^5.2.1+1
rss_dart: ^1.0.3
rss_dart: ^1.0.4
meta: ^1.8.0

dev_dependencies:
Expand Down

0 comments on commit bfaad1d

Please sign in to comment.