Merge pull request #2334 from Bnyro/master

fix download notifications
This commit is contained in:
Bnyro 2022-12-10 13:04:01 +01:00 committed by GitHub
commit 0b34547365
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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
) { else if (downloadId == videoDownloadId) videoDownloadId = null
videoDownloadId -> videoDownloadId = null
audioDownloadId -> audioDownloadId = null
}
if (audioDownloadId != null || videoDownloadId != null) return if (audioDownloadId != null || videoDownloadId != null) return