mirror of
https://github.com/stonega/tsacdop
synced 2025-02-08 07:38:47 +01:00
Remove dead episodes from playlist.
This commit is contained in:
parent
a09718ca91
commit
7bca695437
@ -68,16 +68,22 @@ class Playlist extends Equatable {
|
|||||||
|
|
||||||
Future<void> getPlaylist() async {
|
Future<void> getPlaylist() async {
|
||||||
episodes.clear();
|
episodes.clear();
|
||||||
|
var error = [];
|
||||||
if (episodeList.isNotEmpty) {
|
if (episodeList.isNotEmpty) {
|
||||||
for (var url in episodeList) {
|
for (var url in episodeList) {
|
||||||
var episode = await _dbHelper.getRssItemWithUrl(url);
|
var episode = await _dbHelper.getRssItemWithUrl(url);
|
||||||
if (episode != null) {
|
if (episode != null) {
|
||||||
episodes.add(episode);
|
episodes.add(episode);
|
||||||
} else {
|
} else {
|
||||||
episodeList.remove(url);
|
error.add(url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (error.isNotEmpty) {
|
||||||
|
for (var u in error) {
|
||||||
|
episodeList.remove(u);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Future<void> savePlaylist() async {
|
// Future<void> savePlaylist() async {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user