Skip to content

Commit 197ffbf

Browse files
authored
Merge pull request #12 from Peterkrol12/release/0.8.0
Release 0.8.0
2 parents d8f6d4a + 65a80b9 commit 197ffbf

35 files changed

+123
-117
lines changed

lib/domain/atom_feed.dart

+8-8
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ class AtomFeed {
3636
}
3737

3838
return AtomFeed(
39-
id: feedElement.findElements('id').firstOrNull?.text,
40-
title: feedElement.findElements('title').firstOrNull?.text,
41-
updated:
42-
parseDateTime(feedElement.findElements('updated').firstOrNull?.text),
39+
id: feedElement.findElements('id').firstOrNull?.innerText,
40+
title: feedElement.findElements('title').firstOrNull?.innerText,
41+
updated: parseDateTime(
42+
feedElement.findElements('updated').firstOrNull?.innerText,),
4343
items: feedElement.findElements('entry').map(AtomItem.parse).toList(),
4444
links: feedElement.findElements('link').map(AtomLink.parse).toList(),
4545
authors:
@@ -54,10 +54,10 @@ class AtomFeed {
5454
.findElements('generator')
5555
.map(AtomGenerator.parse)
5656
.firstOrNull,
57-
icon: feedElement.findElements('icon').firstOrNull?.text,
58-
logo: feedElement.findElements('logo').firstOrNull?.text,
59-
rights: feedElement.findElements('rights').firstOrNull?.text,
60-
subtitle: feedElement.findElements('subtitle').firstOrNull?.text,
57+
icon: feedElement.findElements('icon').firstOrNull?.innerText,
58+
logo: feedElement.findElements('logo').firstOrNull?.innerText,
59+
rights: feedElement.findElements('rights').firstOrNull?.innerText,
60+
subtitle: feedElement.findElements('subtitle').firstOrNull?.innerText,
6161
);
6262
}
6363

lib/domain/atom_generator.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class AtomGenerator {
1010
factory AtomGenerator.parse(XmlElement element) {
1111
final uri = element.getAttribute('uri');
1212
final version = element.getAttribute('version');
13-
final value = element.text;
13+
final value = element.innerText;
1414
return AtomGenerator(uri, version, value);
1515
}
1616

lib/domain/atom_item.dart

+8-8
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ class AtomItem {
2929

3030
/// Parse constructor for the AtomItem class, used when 'parsing' a feed
3131
factory AtomItem.parse(XmlElement element) => AtomItem(
32-
id: element.findElements('id').firstOrNull?.text,
33-
title: element.findElements('title').firstOrNull?.text,
34-
updated:
35-
parseDateTime(element.findElements('updated').firstOrNull?.text),
32+
id: element.findElements('id').firstOrNull?.innerText,
33+
title: element.findElements('title').firstOrNull?.innerText,
34+
updated: parseDateTime(
35+
element.findElements('updated').firstOrNull?.innerText,),
3636
authors: element.findElements('author').map(AtomPerson.parse).toList(),
3737
links: element.findElements('link').map(AtomLink.parse).toList(),
3838
categories:
@@ -41,10 +41,10 @@ class AtomItem {
4141
element.findElements('contributor').map(AtomPerson.parse).toList(),
4242
source:
4343
element.findElements('source').map(AtomSource.parse).firstOrNull,
44-
published: element.findElements('published').firstOrNull?.text,
45-
content: element.findElements('content').firstOrNull?.text,
46-
summary: element.findElements('summary').firstOrNull?.text,
47-
rights: element.findElements('rights').firstOrNull?.text,
44+
published: element.findElements('published').firstOrNull?.innerText,
45+
content: element.findElements('content').firstOrNull?.innerText,
46+
summary: element.findElements('summary').firstOrNull?.innerText,
47+
rights: element.findElements('rights').firstOrNull?.innerText,
4848
media: Media.parse(element),
4949
);
5050

lib/domain/atom_person.dart

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ class AtomPerson {
99

1010
/// Parse constructor for the AtomPerson class, used when 'parsing' a feed
1111
factory AtomPerson.parse(XmlElement element) => AtomPerson(
12-
name: element.findElements('name').firstOrNull?.text,
13-
uri: element.findElements('uri').firstOrNull?.text,
14-
email: element.findElements('email').firstOrNull?.text,
12+
name: element.findElements('name').firstOrNull?.innerText,
13+
uri: element.findElements('uri').firstOrNull?.innerText,
14+
email: element.findElements('email').firstOrNull?.innerText,
1515
);
1616

1717
/// The name of the person

lib/domain/atom_source.dart

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ class AtomSource {
1414

1515
/// Parse constructor for the AtomSource class, used when 'parsing' a feed
1616
factory AtomSource.parse(XmlElement element) => AtomSource(
17-
id: element.findElements('id').firstOrNull?.text,
18-
title: element.findElements('title').firstOrNull?.text,
19-
updated: element.findElements('updated').firstOrNull?.text,
17+
id: element.findElements('id').firstOrNull?.innerText,
18+
title: element.findElements('title').firstOrNull?.innerText,
19+
updated: element.findElements('updated').firstOrNull?.innerText,
2020
);
2121

2222
/// The id of the source feed

lib/domain/dublin_core/dublin_core.dart

+22-18
Original file line numberDiff line numberDiff line change
@@ -28,26 +28,30 @@ class DublinCore {
2828

2929
/// Parse constructor for the DublinCore class, used when 'parsing' a feed
3030
factory DublinCore.parse(XmlElement element) => DublinCore(
31-
title: element.findElements('dc:title').firstOrNull?.text,
32-
description: element.findElements('dc:description').firstOrNull?.text,
33-
creator: element.findElements('dc:creator').firstOrNull?.text,
34-
subject: element.findElements('dc:subject').firstOrNull?.text,
35-
publisher: element.findElements('dc:publisher').firstOrNull?.text,
36-
contributor: element.findElements('dc:contributor').firstOrNull?.text,
37-
date: parseDateTime(element.findElements('dc:date').firstOrNull?.text),
38-
created:
39-
parseDateTime(element.findElements('dc:created').firstOrNull?.text),
31+
title: element.findElements('dc:title').firstOrNull?.innerText,
32+
description:
33+
element.findElements('dc:description').firstOrNull?.innerText,
34+
creator: element.findElements('dc:creator').firstOrNull?.innerText,
35+
subject: element.findElements('dc:subject').firstOrNull?.innerText,
36+
publisher: element.findElements('dc:publisher').firstOrNull?.innerText,
37+
contributor:
38+
element.findElements('dc:contributor').firstOrNull?.innerText,
39+
date: parseDateTime(
40+
element.findElements('dc:date').firstOrNull?.innerText,),
41+
created: parseDateTime(
42+
element.findElements('dc:created').firstOrNull?.innerText,),
4043
modified: parseDateTime(
41-
element.findElements('dc:modified').firstOrNull?.text,
44+
element.findElements('dc:modified').firstOrNull?.innerText,
4245
),
43-
type: element.findElements('dc:type').firstOrNull?.text,
44-
format: element.findElements('dc:format').firstOrNull?.text,
45-
identifier: element.findElements('dc:identifier').firstOrNull?.text,
46-
source: element.findElements('dc:source').firstOrNull?.text,
47-
language: element.findElements('dc:language').firstOrNull?.text,
48-
relation: element.findElements('dc:relation').firstOrNull?.text,
49-
coverage: element.findElements('dc:coverage').firstOrNull?.text,
50-
rights: element.findElements('dc:rights').firstOrNull?.text,
46+
type: element.findElements('dc:type').firstOrNull?.innerText,
47+
format: element.findElements('dc:format').firstOrNull?.innerText,
48+
identifier:
49+
element.findElements('dc:identifier').firstOrNull?.innerText,
50+
source: element.findElements('dc:source').firstOrNull?.innerText,
51+
language: element.findElements('dc:language').firstOrNull?.innerText,
52+
relation: element.findElements('dc:relation').firstOrNull?.innerText,
53+
coverage: element.findElements('dc:coverage').firstOrNull?.innerText,
54+
rights: element.findElements('dc:rights').firstOrNull?.innerText,
5155
);
5256

5357
/// The title of the resource

lib/domain/itunes/itunes.dart

+10-9
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,25 @@ class Itunes {
3434
/// Parse constructor for the Itunes class, used when 'parsing' a feed
3535
factory Itunes.parse(XmlElement element) {
3636
final episodeStr =
37-
element.findElements('itunes:episode').firstOrNull?.text ?? '';
37+
element.findElements('itunes:episode').firstOrNull?.innerText ?? '';
3838
final seasonStr =
39-
element.findElements('itunes:season').firstOrNull?.text ?? '';
39+
element.findElements('itunes:season').firstOrNull?.innerText ?? '';
4040
final durationStr =
41-
element.findElements('itunes:duration').firstOrNull?.text ?? '';
41+
element.findElements('itunes:duration').firstOrNull?.innerText ?? '';
4242
return Itunes(
43-
author: element.findElements('itunes:author').firstOrNull?.text,
44-
summary: element.findElements('itunes:summary').firstOrNull?.text,
43+
author: element.findElements('itunes:author').firstOrNull?.innerText,
44+
summary: element.findElements('itunes:summary').firstOrNull?.innerText,
4545
explicit: parseBoolLiteral(element, 'itunes:explicit'),
46-
title: element.findElements('itunes:title').firstOrNull?.text,
47-
subtitle: element.findElements('itunes:subtitle').firstOrNull?.text,
46+
title: element.findElements('itunes:title').firstOrNull?.innerText,
47+
subtitle: element.findElements('itunes:subtitle').firstOrNull?.innerText,
4848
owner: element
4949
.findElements('itunes:owner')
5050
.map(ItunesOwner.parse)
5151
.firstOrNull,
5252
keywords: element
5353
.findElements('itunes:keywords')
5454
.firstOrNull
55-
?.text
55+
?.innerText
5656
.split(',')
5757
.map((keyword) => keyword.trim())
5858
.toList() ??
@@ -66,7 +66,8 @@ class Itunes {
6666
.map(ItunesCategory.parse)
6767
.toList(),
6868
type: element.findElements('itunes:type').map(newItunesType).firstOrNull,
69-
newFeedUrl: element.findElements('itunes:new-feed-url').firstOrNull?.text,
69+
newFeedUrl:
70+
element.findElements('itunes:new-feed-url').firstOrNull?.innerText,
7071
block: parseBoolLiteral(element, 'itunes:block'),
7172
complete: parseBoolLiteral(element, 'itunes:complete'),
7273
episode: episodeStr.isNotEmpty ? int.tryParse(episodeStr) : null,

lib/domain/itunes/itunes_episode_type.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ enum ItunesEpisodeType {
1818

1919
/// Parses the [element] text to a ItunesEpisodeType
2020
ItunesEpisodeType newItunesEpisodeType(XmlElement element) {
21-
switch (element.text) {
21+
switch (element.innerText) {
2222
case 'full':
2323
return ItunesEpisodeType.full;
2424
case 'trailer':

lib/domain/itunes/itunes_owner.dart

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ class ItunesOwner {
99

1010
/// Parse constructor for the ItunesOwner class, used when 'parsing' a feed
1111
factory ItunesOwner.parse(XmlElement element) => ItunesOwner(
12-
name: element.findElements('itunes:name').firstOrNull?.text.trim(),
13-
email: element.findElements('itunes:email').firstOrNull?.text.trim(),
12+
name: element.findElements('itunes:name').firstOrNull?.innerText.trim(),
13+
email:
14+
element.findElements('itunes:email').firstOrNull?.innerText.trim(),
1415
);
1516

1617
/// The name of the podcast owner

lib/domain/itunes/itunes_type.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ enum ItunesType {
1717

1818
/// Parses the [element] text to a ItunesType
1919
ItunesType newItunesType(XmlElement element) {
20-
switch (element.text) {
20+
switch (element.innerText) {
2121
case 'episodic':
2222
return ItunesType.episodic;
2323
case 'serial':

lib/domain/media/category.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Category {
1414
factory Category.parse(XmlElement element) => Category(
1515
scheme: element.getAttribute('scheme'),
1616
label: element.getAttribute('label'),
17-
value: element.text,
17+
value: element.innerText,
1818
);
1919

2020
/// The scheme of the category

lib/domain/media/copyright.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Copyright {
1212
/// Parse constructor for the Copyright class, used when 'parsing' a feed
1313
factory Copyright.parse(XmlElement element) => Copyright(
1414
url: element.getAttribute('url'),
15-
value: element.text,
15+
value: element.innerText,
1616
);
1717

1818
/// The url of the copyright

lib/domain/media/credit.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Credit {
1414
factory Credit.parse(XmlElement element) => Credit(
1515
role: element.getAttribute('role'),
1616
scheme: element.getAttribute('scheme'),
17-
value: element.text,
17+
value: element.innerText,
1818
);
1919

2020
/// The role of the credit

lib/domain/media/description.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Description {
1212
/// Parse constructor for the Description class, used when 'parsing' a feed
1313
factory Description.parse(XmlElement element) => Description(
1414
type: element.getAttribute('type'),
15-
value: element.text,
15+
value: element.innerText,
1616
);
1717

1818
/// The type of the description

lib/domain/media/hash.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Hash {
1212
/// Parse constructor for the Hash class, used when 'parsing' a feed
1313
factory Hash.parse(XmlElement element) => Hash(
1414
algo: element.getAttribute('algo'),
15-
value: element.text,
15+
value: element.innerText,
1616
);
1717

1818
/// The algorithm of the hash

lib/domain/media/license.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class License {
1414
factory License.parse(XmlElement element) => License(
1515
type: element.getAttribute('type'),
1616
href: element.getAttribute('href'),
17-
value: element.text,
17+
value: element.innerText,
1818
);
1919

2020
/// The type of the license

lib/domain/media/media.dart

+4-4
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class Media {
7474
.findElements('media:description')
7575
.map(Description.parse)
7676
.firstOrNull,
77-
keywords: element.findElements('media:keywords').firstOrNull?.text,
77+
keywords: element.findElements('media:keywords').firstOrNull?.innerText,
7878
thumbnails: element
7979
.findElements('media:thumbnail')
8080
.map(Thumbnail.parse)
@@ -99,22 +99,22 @@ class Media {
9999
.findElements('media:comments')
100100
.firstOrNull
101101
?.findElements('media:comment')
102-
.map((e) => e.text)
102+
.map((e) => e.innerText)
103103
.toList() ??
104104
[],
105105
embed: element.findElements('media:embed').map(Embed.parse).firstOrNull,
106106
responses: element
107107
.findElements('media:responses')
108108
.firstOrNull
109109
?.findElements('media:response')
110-
.map((e) => e.text)
110+
.map((e) => e.innerText)
111111
.toList() ??
112112
[],
113113
backLinks: element
114114
.findElements('media:backLinks')
115115
.firstOrNull
116116
?.findElements('media:backLink')
117-
.map((e) => e.text)
117+
.map((e) => e.innerText)
118118
.toList() ??
119119
[],
120120
status:

lib/domain/media/param.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Param {
1212
/// Parse constructor for the Param class, used when 'parsing' a feed
1313
factory Param.parse(XmlElement element) => Param(
1414
name: element.getAttribute('name'),
15-
value: element.text,
15+
value: element.innerText,
1616
);
1717

1818
/// The name of the parameter

lib/domain/media/peer_link.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class PeerLink {
1414
factory PeerLink.parse(XmlElement element) => PeerLink(
1515
type: element.getAttribute('type'),
1616
href: element.getAttribute('href'),
17-
value: element.text,
17+
value: element.innerText,
1818
);
1919

2020
/// The type of the P2P link

lib/domain/media/player.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Player {
1616
url: element.getAttribute('url'),
1717
width: int.tryParse(element.getAttribute('width') ?? '0'),
1818
height: int.tryParse(element.getAttribute('height') ?? '0'),
19-
value: element.text,
19+
value: element.innerText,
2020
);
2121

2222
/// The url of the player

lib/domain/media/rating.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Rating {
1212
/// Parse constructor for the Rating class, used when 'parsing' a feed
1313
factory Rating.parse(XmlElement element) => Rating(
1414
scheme: element.getAttribute('scheme'),
15-
value: element.text,
15+
value: element.innerText,
1616
);
1717

1818
/// The scheme of the rating

lib/domain/media/restriction.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Restriction {
1414
factory Restriction.parse(XmlElement element) => Restriction(
1515
relationship: element.getAttribute('relationship'),
1616
type: element.getAttribute('type'),
17-
value: element.text,
17+
value: element.innerText,
1818
);
1919

2020
/// The relationship of the restriction

lib/domain/media/scene.dart

+6-4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ class Scene {
1414

1515
/// Parse constructor for the Scene class, used when 'parsing' a feed
1616
factory Scene.parse(XmlElement element) => Scene(
17-
title: element.findElements('sceneTitle').firstOrNull?.text,
18-
description: element.findElements('sceneDescription').firstOrNull?.text,
19-
startTime: element.findElements('sceneStartTime').firstOrNull?.text,
20-
endTime: element.findElements('sceneEndTime').firstOrNull?.text,
17+
title: element.findElements('sceneTitle').firstOrNull?.innerText,
18+
description:
19+
element.findElements('sceneDescription').firstOrNull?.innerText,
20+
startTime:
21+
element.findElements('sceneStartTime').firstOrNull?.innerText,
22+
endTime: element.findElements('sceneEndTime').firstOrNull?.innerText,
2123
);
2224

2325
/// The title of the scene

lib/domain/media/tags.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Tags {
1111

1212
/// Parse constructor for the Tags class, used when 'parsing' a feed
1313
factory Tags.parse(XmlElement element) => Tags(
14-
tags: element.text,
14+
tags: element.innerText,
1515
weight: int.tryParse(element.getAttribute('weight') ?? '1'),
1616
);
1717

lib/domain/media/text.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Text {
1818
lang: element.getAttribute('lang'),
1919
start: element.getAttribute('start'),
2020
end: element.getAttribute('end'),
21-
value: element.text,
21+
value: element.innerText,
2222
);
2323

2424
/// The type of the text

lib/domain/media/title.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Title {
1212
/// Parse constructor for the Title class, used when 'parsing' a feed
1313
factory Title.parse(XmlElement element) => Title(
1414
type: element.getAttribute('type'),
15-
value: element.text,
15+
value: element.innerText,
1616
);
1717

1818
/// The type of the title

0 commit comments

Comments
 (0)