Make external media follow app preferences (#433)

This commit is contained in:
Natanel Shitrit 2023-07-09 16:19:39 +03:00 committed by GitHub
parent 7a3b67f64b
commit 096dd25a94
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -222,7 +222,8 @@ class DownloaderImpl(
database.insertMediaStream(mediaStream.toFindroidMediaStreamDto(id, source.id, streamPath.path.orEmpty()))
val request = DownloadManager.Request(Uri.parse(mediaStream.path))
.setTitle(mediaStream.title)
.setAllowedNetworkTypes(DownloadManager.Request.NETWORK_WIFI)
.setAllowedOverMetered(appPreferences.downloadOverMobileData)
.setAllowedOverRoaming(appPreferences.downloadWhenRoaming)
.setNotificationVisibility(DownloadManager.Request.VISIBILITY_HIDDEN)
.setDestinationUri(streamPath)
val downloadId = downloadManager.enqueue(request)