fix download notifications

This commit is contained in:
Bnyro 2022-12-10 13:03:47 +01:00
parent d1df440fa4
commit a629b066f4

View File

@ -102,15 +102,12 @@ class DownloadService : Service() {
override fun onReceive(context: Context, intent: Intent) { override fun onReceive(context: Context, intent: Intent) {
// Fetching the download id received with the broadcast // Fetching the download id received with the broadcast
// Checking if the received broadcast is for our enqueued download by matching download id // Checking if the received broadcast is for our enqueued download by matching download id
when ( val downloadId = intent.getLongExtra(
intent.getLongExtra(
DownloadManager.EXTRA_DOWNLOAD_ID, DownloadManager.EXTRA_DOWNLOAD_ID,
-1 -1
) )
) { if (downloadId == audioDownloadId) audioDownloadId = null
videoDownloadId -> videoDownloadId = null else if (downloadId == videoDownloadId) videoDownloadId = null
audioDownloadId -> audioDownloadId = null
}
if (audioDownloadId != null || videoDownloadId != null) return if (audioDownloadId != null || videoDownloadId != null) return