1
0
mirror of https://github.com/stonega/tsacdop synced 2024-12-08 06:31:51 +01:00
tsacdop-podcast-app-android/lib/webfeed/domain/rss_item.dart
stonegate 16567a7199 new file: lib/class/podcast_group.dart
modified:   lib/class/podcastlocal.dart
	modified:   lib/class/settingstate.dart
	modified:   lib/episodes/episodedetail.dart
	modified:   lib/episodes/episodedownload.dart
	modified:   lib/home/appbar/addpodcast.dart
	modified:   lib/home/appbar/popupmenu.dart
	modified:   lib/home/audio_player.dart
	modified:   lib/home/home.dart
	modified:   lib/home/homescroll.dart
	modified:   lib/home/hometab.dart
	new file:   lib/local_storage/key_value_storage.dart
	renamed:    lib/class/sqflite_localpodcast.dart -> lib/local_storage/sqflite_localpodcast.dart
	modified:   lib/main.dart
	modified:   lib/podcasts/podcastdetail.dart
	new file:   lib/podcasts/podcastgroup.dart
	modified:   lib/podcasts/podcastlist.dart
	modified:   lib/podcasts/podcastmanage.dart
	modified:   lib/util/episodegrid.dart
	modified:   lib/webfeed/domain/rss_item.dart
	modified:   lib/webfeed/domain/rss_itunes.dart
	modified:   pubspec.lock
	modified:   pubspec.yaml
Add podcast group support
Manage group with provider
2020-02-20 17:09:21 +08:00

67 lines
2.0 KiB
Dart

import '../domain/dublin_core/dublin_core.dart';
import '../domain/media/media.dart';
import '../domain/rss_category.dart';
import '../domain/rss_content.dart';
import '../domain/rss_enclosure.dart';
import '../domain/rss_source.dart';
import '../util/helpers.dart';
import 'package:xml/xml.dart';
import 'rss_item_itunes.dart';
class RssItem {
final String title;
final String description;
final String link;
final List<RssCategory> categories;
final String guid;
final String pubDate;
final String author;
final String comments;
final RssSource source;
final RssContent content;
final Media media;
final RssEnclosure enclosure;
final DublinCore dc;
final RssItemItunes itunes;
RssItem({
this.title,
this.description,
this.link,
this.categories,
this.guid,
this.pubDate,
this.author,
this.comments,
this.source,
this.content,
this.media,
this.enclosure,
this.dc,
this.itunes,
});
factory RssItem.parse(XmlElement element) {
return RssItem(
title: findElementOrNull(element, "title")?.text,
description: findElementOrNull(element, "description")?.text?.trim() ?? 'No shownote provided for this episode',
link: findElementOrNull(element, "link")?.text?.trim(),
categories: element.findElements("category").map((element) {
return RssCategory.parse(element);
}).toList(),
//guid: findElementOrNull(element, "guid")?.text,
pubDate: findElementOrNull(element, "pubDate")?.text?.trim(),
author: findElementOrNull(element, "author")?.text?.trim(),
// comments: findElementOrNull(element, "comments")?.text,
// source: RssSource.parse(findElementOrNull(element, "source")),
// content: RssContent.parse(findElementOrNull(element, "content:encoded")),
// media: Media.parse(element),
enclosure: RssEnclosure.parse(findElementOrNull(element, "enclosure")),
//dc: DublinCore.parse(element),
itunes: RssItemItunes.parse(element),
);
}
}