Skip to content

Commit

Permalink
Add support for Podcasting 2.0 GUID tag. Update http library to 1.1.0…
Browse files Browse the repository at this point in the history
… Dart 3 version.
  • Loading branch information
amugofjava committed Jul 27, 2023
1 parent e98fa56 commit 8cc0114
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

# 1.0.4

* Add support for Podcasting 2.0 GUID tag.
* Update http library to 1.1.0 release.

# 1.0.3

* Add support for Podcasting 2.0 Person tag.
Expand Down
3 changes: 3 additions & 0 deletions lib/domain/podcast_index/rss_podcast_index.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ import 'package:rss_dart/util/helpers.dart';
import 'package:xml/xml.dart';

class RssPodcastIndex {
final String? guid;
final List<RssPodcastIndexFunding?>? funding;
final List<RssPodcastIndexPerson?>? persons;
final RssPodcastIndexLocked? locked;

RssPodcastIndex({
this.guid,
this.funding,
this.persons,
this.locked,
Expand All @@ -21,6 +23,7 @@ class RssPodcastIndex {
}

return RssPodcastIndex(
guid: findElementOrNull(element, 'podcast:guid')?.innerText,
funding: element.findElements('podcast:funding').map((e) {
return RssPodcastIndexFunding.parse(e);
}).toList(),
Expand Down
7 changes: 4 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
name: rss_dart
version: 1.0.3
version: 1.0.4
description: dart-rss is a rss parser for RSS1.0/RSS2.0/Atom. It also support Dublin-Core, Content, Syndication additional modules. This libary is forked from webfeed(https://github.com/witochandra/webfeed).
homepage: https://github.com/sudame/dart-rss
homepage: https://github.com/ubuntu-flutter-community/rss.dart

environment:
sdk: ">=3.0.0 <4.0.0"
dependencies:
xml: ^6.3.0
http: ^0.13.0
http: ^1.1.0
intl: ^0.18.0

dev_dependencies:
Expand Down
3 changes: 2 additions & 1 deletion test/rss_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void main() {

expect(
feed.items.first.content!.value,
'<img width=\"1000\" height=\"690\" src=\"https://test.com/image_link\"/> Test content<br />',
'<img alt="unit test image" width=\"1000\" height=\"690\" src=\"https://test.com/image_link\"/> Test content<br />',
);
expect(
feed.items.first.content!.images.first,
Expand Down Expand Up @@ -421,6 +421,7 @@ void main() {
expect(feed.generator, 'Freedom Controller');
expect(feed.webMaster, '[email protected] (Tech Support)');

expect(feed.podcastIndex!.guid, '20a14457-0993-49b8-a37a-18384e7f91f8');
expect(feed.podcastIndex!.locked!.locked, true);
expect(feed.podcastIndex!.locked!.owner, '[email protected]');
expect(feed.podcastIndex!.funding![0]!.url, 'https://example.com/donate');
Expand Down
1 change: 1 addition & 0 deletions test/xml/RSS-PodcastIndex-R1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<link>https://example.com/show</link>
</image>

<podcast:guid>20a14457-0993-49b8-a37a-18384e7f91f8</podcast:guid>
<podcast:locked owner="[email protected]">yes</podcast:locked>
<podcast:funding url="https://example.com/donate">Support the show!</podcast:funding>
<podcast:funding url="https://example.com/member">Become a member!</podcast:funding>
Expand Down
2 changes: 1 addition & 1 deletion test/xml/RSS.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<author>[email protected]</author>
<source url="https://foo.bar.news/1?source">Foo Bar</source>
<comments>https://foo.bar.news/1/comments</comments>
<content:encoded><![CDATA[<img width="1000" height="690" src="https://test.com/image_link"/> Test content<br />]]></content:encoded>
<content:encoded><![CDATA[<img alt="unit test image" width="1000" height="690" src="https://test.com/image_link"/> Test content<br />]]></content:encoded>
<enclosure url="http://www.scripting.com/mp3s/weatherReportSuite.mp3" length="12216320" type="audio/mpeg" />
</item>
<item>
Expand Down

0 comments on commit 8cc0114

Please sign in to comment.