1
0
mirror of https://github.com/stonega/tsacdop synced 2024-12-08 14:35:47 +01:00
tsacdop-podcast-app-android/lib/webfeed/domain/rss_enclosure.dart
2020-02-09 20:29:09 +08:00

20 lines
477 B
Dart

import 'package:xml/xml.dart';
class RssEnclosure {
final String url;
final String type;
final int length;
RssEnclosure(this.url, this.type, this.length);
factory RssEnclosure.parse(XmlElement element) {
if (element == null) {
return null;
}
var url = element.getAttribute("url");
var type = element.getAttribute("type");
var length = int.tryParse(element.getAttribute("length") ?? "0");
return RssEnclosure(url, type, length);
}
}