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) {
// Fetching the download id received with the broadcast
// Checking if the received broadcast is for our enqueued download by matching download id
when (
intent.getLongExtra(
val downloadId = intent.getLongExtra(
DownloadManager.EXTRA_DOWNLOAD_ID,
-1
)
) {
videoDownloadId -> videoDownloadId = null
audioDownloadId -> audioDownloadId = null
}
if (downloadId == audioDownloadId) audioDownloadId = null
else if (downloadId == videoDownloadId) videoDownloadId = null
if (audioDownloadId != null || videoDownloadId != null) return