Fixed bulk live download when user chooses to sync starred tracks

This commit is contained in:
antonio 2023-03-12 17:59:12 +01:00
parent 3f6f3ab06a
commit da7030bee1
7 changed files with 60 additions and 14 deletions

View file

@ -69,6 +69,7 @@ public class DownloaderService extends androidx.media3.exoplayer.offline.Downloa
if (download.state == Download.STATE_COMPLETED) {
notification = notificationHelper.buildDownloadCompletedNotification(context, R.drawable.ic_check_circle, null, Util.fromUtf8Bytes(download.request.data));
DownloaderManager.updateDatabase(download.request.id);
} else if (download.state == Download.STATE_FAILED) {
notification = notificationHelper.buildDownloadFailedNotification(context, R.drawable.ic_error, null, Util.fromUtf8Bytes(download.request.data));
} else {
@ -77,5 +78,10 @@ public class DownloaderService extends androidx.media3.exoplayer.offline.Downloa
NotificationUtil.setNotification(context, nextNotificationId++, notification);
}
@Override
public void onDownloadRemoved(@NonNull DownloadManager downloadManager, Download download) {
DownloaderManager.deleteDatabase(download.request.id);
}
}
}