1
0
Fork 0
mirror of https://github.com/TeamNewPipe/NewPipe.git synced 2025-10-03 09:49:21 +02:00

Apply review suggestions

This commit is contained in:
whistlingwoods 2025-09-06 19:14:15 +05:30
parent 9282cce6a8
commit 21e24c9e34

View file

@ -169,7 +169,7 @@ public class DownloadManager {
// DON'T delete missions with storage issues - try to recover them
if (mis.hasInvalidStorage() && mis.errCode != ERROR_PROGRESS_LOST) {
// Only delete if it's truly unrecoverable (not just progress lost)
if (mis.storage == null && mis.errCode != ERROR_PROGRESS_LOST) {
if (mis.storage == null) {
//noinspection ResultOfMethodCallIgnored
sub.delete();
continue;
@ -612,12 +612,9 @@ public class DownloadManager {
// Don't hide recoverable missions
remove.removeIf(mission -> {
if (mission instanceof DownloadMission) {
DownloadMission dm = (DownloadMission) mission;
if (canRecoverMission(dm)) {
if (mission instanceof DownloadMission dm && canRecoverMission(dm)) {
return false; // Don't remove recoverable missions
}
}
return pending.remove(mission) || finished.remove(mission);
});