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) {
// 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