1
0
Fork 0
mirror of https://github.com/TeamNewPipe/NewPipe.git synced 2025-10-03 17:59:41 +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 // DON'T delete missions with storage issues - try to recover them
if (mis.hasInvalidStorage() && mis.errCode != ERROR_PROGRESS_LOST) { if (mis.hasInvalidStorage() && mis.errCode != ERROR_PROGRESS_LOST) {
// Only delete if it's truly unrecoverable (not just 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 //noinspection ResultOfMethodCallIgnored
sub.delete(); sub.delete();
continue; continue;
@ -612,12 +612,9 @@ public class DownloadManager {
// Don't hide recoverable missions // Don't hide recoverable missions
remove.removeIf(mission -> { remove.removeIf(mission -> {
if (mission instanceof DownloadMission) { if (mission instanceof DownloadMission dm && canRecoverMission(dm)) {
DownloadMission dm = (DownloadMission) mission;
if (canRecoverMission(dm)) {
return false; // Don't remove recoverable missions return false; // Don't remove recoverable missions
} }
}
return pending.remove(mission) || finished.remove(mission); return pending.remove(mission) || finished.remove(mission);
}); });