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]);