From b3f10892f4e6e134c4e63f1649e696bc0347dddd Mon Sep 17 00:00:00 2001 From: stonegate Date: Sat, 1 Aug 2020 23:11:12 +0800 Subject: [PATCH] Bug fixed. --- lib/local_storage/sqflite_localpodcast.dart | 5 +++-- lib/state/podcast_group.dart | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/local_storage/sqflite_localpodcast.dart b/lib/local_storage/sqflite_localpodcast.dart index 5e66e25..7d60c1b 100644 --- a/lib/local_storage/sqflite_localpodcast.dart +++ b/lib/local_storage/sqflite_localpodcast.dart @@ -1058,8 +1058,9 @@ class DBHelper { Future isDownloaded(String url) async { var dbClient = await database; List list = await dbClient.rawQuery( - "SELECT downloaded FROM Episodes WHERE enclosure_url = ?", [url]); - return list.first['downloaded'] == 'ND' ? false : true; + "SELECT id FROM Episodes WHERE enclosure_url = ? AND enclosure_url != media_id", + [url]); + return list.isNotEmpty; } Future saveDownloaded(String url, String id) async { diff --git a/lib/state/podcast_group.dart b/lib/state/podcast_group.dart index 6797340..8d67b94 100644 --- a/lib/state/podcast_group.dart +++ b/lib/state/podcast_group.dart @@ -150,8 +150,9 @@ class GroupList extends ChangeNotifier { SubscribeItem _currentSubscribeItem = SubscribeItem('', ''); SubscribeItem get currentSubscribeItem => _currentSubscribeItem; - /// Default false, true if subscribe isolate is created. bool _created = false; + + /// Default false, true if subscribe isolate is created. bool get created => _created; /// Add subsribe item @@ -452,7 +453,6 @@ Future subIsolateEntryPoint(SendPort sendPort) async { try { p = RssFeed.parse(response.data); } catch (e) { - print(e); sendPort.send([item.title, item.url, 6]); await Future.delayed(Duration(seconds: 2)); sendPort.send([item.title, item.url, 4]); @@ -567,7 +567,7 @@ Future subIsolateEntryPoint(SendPort sendPort) async { } } } catch (e) { - print(e); + print('$e confirm'); sendPort.send([item.title, item.url, 6]); await Future.delayed(Duration(seconds: 2)); sendPort.send([item.title, item.url, 4]);