Revert "Stop looping over unplayable songs"

This reverts commit 22c98d9606.
This commit is contained in:
Andrew Rabert 2019-12-28 11:04:37 -05:00
parent 23054ffab0
commit 8ee8858098
1 changed files with 9 additions and 4 deletions

View File

@ -1370,10 +1370,15 @@ public class DownloadService extends Service {
final int duration = downloadFile.getSong().getDuration() == null ? 0 : downloadFile.getSong().getDuration() * 1000; final int duration = downloadFile.getSong().getDuration() == null ? 0 : downloadFile.getSong().getDuration() * 1000;
mediaPlayer.setOnErrorListener((mediaPlayer, what, extra) -> { mediaPlayer.setOnErrorListener((mediaPlayer, what, extra) -> {
Log.w(TAG, "Error on playing file " + "(" + what + ", " + extra + "): " + downloadFile); Log.w(TAG, "Error on playing file " + "(" + what + ", " + extra + "): " + downloadFile);
int index = getNextPlayingIndex(); int pos = getPlayerPosition();
remove(downloadFile); reset();
downloadFile.delete(); if (!isPartial || (downloadFile.isWorkDone() && (Math.abs(duration - pos) < 10000))) {
play(index - 1); playNext();
} else {
downloadFile.setPlaying(false);
doPlay(downloadFile, pos, isPlaying);
downloadFile.setPlaying(true);
}
return true; return true;
}); });