use of com.simplecity.amp_library.utils.extensions.SongExtKt in project Shuttle by timusus.
the class DeleteDialog method deleteSongs.
@SuppressLint("CheckResult")
Single<Integer> deleteSongs() {
return Single.fromCallable(() -> {
int deletedSongs = 0;
if (!documentFilesForDeletion.isEmpty()) {
deletedSongs += Stream.of(documentFilesForDeletion).filter(DocumentFile::delete).count();
tidyUp(songsForSafDeletion);
documentFilesForDeletion.clear();
songsForSafDeletion.clear();
}
if (!songsForNormalDeletion.isEmpty()) {
deletedSongs += Stream.of(songsForNormalDeletion).filter(SongExtKt::delete).count();
tidyUp(songsForNormalDeletion);
songsForNormalDeletion.clear();
}
return deletedSongs;
});
}
Aggregations