1
0
mirror of https://github.com/stonega/tsacdop synced 2025-01-09 13:53:38 +01:00
tsacdop-podcast-app-android/lib/webfeed/domain/rss_itunes.dart
stonegate 9d4bbc895a modified: .circleci/config.yml
modified:   lib/class/episodebrief.dart
	modified:   lib/class/podcast_group.dart
	deleted:    lib/class/podcastrss.dart
	deleted:    lib/class/podcastrss.g.dart
	deleted:    lib/class/podcasts.dart
	deleted:    lib/class/podcasts.g.dart
	modified:   lib/episodes/episodedetail.dart
	modified:   lib/home/appbar/about.dart
	modified:   lib/home/appbar/addpodcast.dart
	modified:   lib/home/appbar/popupmenu.dart
	modified:   lib/home/homescroll.dart
	modified:   lib/local_storage/sqflite_localpodcast.dart
	modified:   lib/main.dart
	modified:   lib/podcasts/podcastdetail.dart
	modified:   lib/podcasts/podcastgroup.dart
	modified:   lib/podcasts/podcastlist.dart
	modified:   lib/podcasts/podcastmanage.dart
	modified:   lib/util/episodegrid.dart
	modified:   lib/webfeed/domain/rss_itunes.dart
	modified:   pubspec.lock
	modified:   pubspec.yaml
2020-02-21 23:04:02 +08:00

71 lines
2.1 KiB
Dart

import '../util/helpers.dart';
import 'package:xml/xml.dart';
//import 'package:webfeed/util/helpers.dart';
import 'rss_itunes_category.dart';
import 'rss_itunes_image.dart';
import 'rss_itunes_owner.dart';
import 'rss_itunes_type.dart';
class RssItunes {
final String author;
final String summary;
final bool explicit;
final String title;
final String subtitle;
final RssItunesOwner owner;
final List<String> keywords;
final RssItunesImage image;
final List<RssItunesCategory> categories;
final RssItunesType type;
final String newFeedUrl;
final bool block;
final bool complete;
RssItunes({
this.author,
this.summary,
this.explicit,
this.title,
this.subtitle,
this.owner,
this.keywords,
this.image,
this.categories,
this.type,
this.newFeedUrl,
this.block,
this.complete,
});
factory RssItunes.parse(XmlElement element) {
if (element == null) {
return null;
}
return RssItunes(
author: findElementOrNull(element, "itunes:author")?.text?.trim(),
summary: findElementOrNull(element, "itunes:summary")?.text?.trim(),
explicit: parseBoolLiteral(element, "itunes:explicit"),
title: findElementOrNull(element, "itunes:title")?.text?.trim(),
// subtitle: findElementOrNull(element, "itunes:subtitle")?.text?.trim(),
//owner: RssItunesOwner.parse(findElementOrNull(element, "itunes:owner")),
// keywords: findElementOrNull(element, "itunes:keywords")
// ?.text
// ?.split(",")
// ?.map((keyword) => keyword.trim())
// ?.toList(),
image: RssItunesImage.parse(findElementOrNull(element, "itunes:image")),
// categories: findAllDirectElementsOrNull(element, "itunes:category")
// .map((ele) => RssItunesCategory.parse(ele))
// .toList(),
// type: newRssItunesType(findElementOrNull(element, "itunes:type")),
// newFeedUrl:
// findElementOrNull(element, "itunes:new-feed-url")?.text?.trim(),
// block: parseBoolLiteral(element, "itunes:block"),
// complete: parseBoolLiteral(element, "itunes:complete"),
);
}
}