Minor change.

This commit is contained in:
stonegate 2020-10-01 17:44:39 +08:00
parent 5dcdba41cd
commit fa883a4722
6 changed files with 11 additions and 13 deletions

View File

@ -10,8 +10,6 @@ Release date 2020/10/1
* Option to hide podcast discovery in search page. * Option to hide podcast discovery in search page.
* Italian translation support, thanks Edoardo. * Italian translation support, thanks Edoardo.
### Bug fixed ### Bug fixed
* Mark all listened error. * Mark all listened error.
@ -217,13 +215,13 @@ Release date 2020/7/16
## New features ## New features
* OMPL backup file supports group. * OPML backup file supports group.
* Add settings backup and restore. * Add settings backup and restore.
* Enable R8 and dart obfuscate. * Enable R8 and dart obfuscate.
## Bugs fixed ## Bugs fixed
* OMPL import not shown in group. * OPML import not shown in group.
## Minor UI change ## Minor UI change

View File

@ -22,7 +22,7 @@ The podcast search engine is powered by [ListenNotes](https://listennotes.com).
* Podcast group management * Podcast group management
* Playlist support * Playlist support
* Sleep timer / speed setting * Sleep timer / speed setting
* OMPL file export and import * OPML file export and import
* Auto syncing in background * Auto syncing in background
* Listening and subscription history record * Listening and subscription history record
* Dark mode / accent color * Dark mode / accent color

View File

@ -58,7 +58,7 @@ class _PopupMenuState extends State<PopupMenu> {
var file = File(path); var file = File(path);
try { try {
final opml = file.readAsStringSync(); final opml = file.readAsStringSync();
Map<String, List<OmplOutline>> data = PodcastsBackup.parseOMPL(opml); Map<String, List<OmplOutline>> data = PodcastsBackup.parseOPML(opml);
for (var entry in data.entries) { for (var entry in data.entries) {
var title = entry.key; var title = entry.key;
var list = entry.value.reversed; var list = entry.value.reversed;

View File

@ -54,13 +54,13 @@ class PodcastsBackup {
return builder.build(); return builder.build();
} }
static parseOMPL(String opml) { static parseOPML(String opml) {
var data = <String, List<OmplOutline>>{}; var data = <String, List<OmplOutline>>{};
// var opml = file.readAsStringSync(); // var opml = file.readAsStringSync();
var content = xml.XmlDocument.parse(opml); var content = xml.XmlDocument.parse(opml);
var title = var title =
content.findAllElements('head').first.findElements('title').first.text; content.findAllElements('head').first.findElements('title').first.text;
developer.log(title, name: 'Import OMPL'); developer.log(title, name: 'Import OPML');
var groups = content.findAllElements('body').first.findElements('outline'); var groups = content.findAllElements('body').first.findElements('outline');
if (title != 'Tsacdop Feed Groups') { if (title != 'Tsacdop Feed Groups') {
var total = content var total = content

View File

@ -44,7 +44,7 @@ class _DataBackupState extends State<DataBackup> {
now.month.toString() + now.month.toString() +
now.day.toString() + now.day.toString() +
now.second.toString(); now.second.toString();
var file = File(path.join(tempdir.path, 'tsacdop_ompl_$datePlus.xml')); var file = File(path.join(tempdir.path, 'tsacdop_opml_$datePlus.xml'));
await file.writeAsString(opml.toXmlString()); await file.writeAsString(opml.toXmlString());
return file; return file;
} }
@ -57,7 +57,7 @@ class _DataBackupState extends State<DataBackup> {
Future<void> _shareFile(File file) async { Future<void> _shareFile(File file) async {
final bytes = await file.readAsBytes(); final bytes = await file.readAsBytes();
await WcFlutterShare.share( await WcFlutterShare.share(
sharePopupTitle: 'share Clip', sharePopupTitle: 'Share file',
fileName: file.path.split('/').last, fileName: file.path.split('/').last,
mimeType: 'text/plain', mimeType: 'text/plain',
bytesOfFile: bytes.buffer.asUint8List()); bytesOfFile: bytes.buffer.asUint8List());
@ -653,7 +653,7 @@ class __LoginGpodderState extends State<_LoginGpodder> {
var rssExp = RegExp(r'^(https?):\/\/(.*)'); var rssExp = RegExp(r'^(https?):\/\/(.*)');
final opml = await gpodder.getAllPodcast(); final opml = await gpodder.getAllPodcast();
if (opml != '') { if (opml != '') {
Map<String, List<OmplOutline>> data = PodcastsBackup.parseOMPL(opml); Map<String, List<OmplOutline>> data = PodcastsBackup.parseOPML(opml);
for (var entry in data.entries) { for (var entry in data.entries) {
var list = entry.value.reversed; var list = entry.value.reversed;
for (var rss in list) { for (var rss in list) {
@ -1005,7 +1005,7 @@ class __GpodderInfoState extends State<_GpodderInfo> {
var rssExp = RegExp(r'^(https?):\/\/(.*)'); var rssExp = RegExp(r'^(https?):\/\/(.*)');
final opml = await _gpodder.getAllPodcast(); final opml = await _gpodder.getAllPodcast();
if (opml != '') { if (opml != '') {
Map<String, List<OmplOutline>> data = PodcastsBackup.parseOMPL(opml); Map<String, List<OmplOutline>> data = PodcastsBackup.parseOPML(opml);
for (var entry in data.entries) { for (var entry in data.entries) {
var list = entry.value.reversed; var list = entry.value.reversed;
for (var rss in list) { for (var rss in list) {

View File

@ -440,7 +440,7 @@ class GroupList extends ChangeNotifier {
} }
} }
/// Subscribe podcast from OMPL. /// Subscribe podcast from OPML.
Future<bool> _subscribeNewPodcast( Future<bool> _subscribeNewPodcast(
{String id, String groupName = 'Home'}) async { {String id, String groupName = 'Home'}) async {
//List<String> groupNames = _groups.map((e) => e.name).toList(); //List<String> groupNames = _groups.map((e) => e.name).toList();