mirror of
https://github.com/stonega/tsacdop
synced 2025-02-17 20:10:37 +01:00
Fixed issue mark all listened failed.
This commit is contained in:
parent
b5b947b988
commit
80a4c9bc1b
@ -306,7 +306,7 @@ class DBHelper {
|
||||
var dbClient = await database;
|
||||
final milliseconds = DateTime.now().millisecondsSinceEpoch;
|
||||
var recent = await getPlayHistory(1);
|
||||
if (recent.isNotEmpty) {
|
||||
if (recent.isNotEmpty && recent.first.title == history.title) {
|
||||
await dbClient.rawDelete("DELETE FROM PlayHistory WHERE add_date = ?",
|
||||
[recent.first.playdate.millisecondsSinceEpoch]);
|
||||
}
|
||||
@ -671,8 +671,8 @@ class DBHelper {
|
||||
E.milliseconds, P.imagePath, P.title as feed_title, E.duration, E.explicit,
|
||||
P.primaryColor FROM Episodes E INNER JOIN PodcastLocal P ON E.feed_id = P.id
|
||||
LEFT JOIN PlayHistory H ON E.enclosure_url = H.enclosure_url
|
||||
WHERE P.id = ? AND H.SUM(listen_time) > 0 ORDER BY E.milliseconds ASC""",
|
||||
[id]);
|
||||
WHERE P.id = ? GROUP BY E.enclosure_url HAVING SUM(H.listen_time) is null
|
||||
OR SUM(H.listen_time) = 0 ORDER BY E.milliseconds ASC""", [id]);
|
||||
break;
|
||||
case Filter.liked:
|
||||
list = await dbClient.rawQuery(
|
||||
|
@ -91,13 +91,11 @@ class _PodcastSettingState extends State<PodcastSetting> {
|
||||
setState(() {
|
||||
_markStatus = MarkStatus.start;
|
||||
});
|
||||
var episodes = await _dbHelper.getRssItem(podcastId, -1, reverse: true);
|
||||
final episodes = await _dbHelper.getRssItem(podcastId, -1,
|
||||
reverse: true, hideListened: true);
|
||||
for (var episode in episodes) {
|
||||
final marked = await _dbHelper.checkMarked(episode);
|
||||
if (!marked) {
|
||||
final history = PlayHistory(episode.title, episode.enclosureUrl, 0, 1);
|
||||
await _dbHelper.saveHistory(history);
|
||||
}
|
||||
final history = PlayHistory(episode.title, episode.enclosureUrl, 0, 1);
|
||||
await _dbHelper.saveHistory(history);
|
||||
}
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user