mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-01-07 10:00:31 +05:30
Simplified the download notification
This commit is contained in:
parent
441087d871
commit
234ca8c08f
@ -48,7 +48,7 @@ class DownloadService : Service() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (downloadType != DownloadType.NONE) {
|
if (downloadType != DownloadType.NONE) {
|
||||||
downloadManager()
|
downloadManager(videoName)
|
||||||
} else {
|
} else {
|
||||||
onDestroy()
|
onDestroy()
|
||||||
}
|
}
|
||||||
@ -60,7 +60,7 @@ class DownloadService : Service() {
|
|||||||
TODO("Not yet implemented")
|
TODO("Not yet implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun downloadManager() {
|
private fun downloadManager(videoName: String) {
|
||||||
// initialize and create the directories to download into
|
// initialize and create the directories to download into
|
||||||
|
|
||||||
val videoDownloadDir = DownloadHelper.getVideoDir(this)
|
val videoDownloadDir = DownloadHelper.getVideoDir(this)
|
||||||
@ -74,7 +74,7 @@ class DownloadService : Service() {
|
|||||||
)
|
)
|
||||||
if (downloadType in listOf(DownloadType.VIDEO, DownloadType.AUDIO_VIDEO)) {
|
if (downloadType in listOf(DownloadType.VIDEO, DownloadType.AUDIO_VIDEO)) {
|
||||||
videoDownloadId = downloadManagerRequest(
|
videoDownloadId = downloadManagerRequest(
|
||||||
getString(R.string.video),
|
videoName,
|
||||||
getString(R.string.downloading),
|
getString(R.string.downloading),
|
||||||
videoUrl,
|
videoUrl,
|
||||||
Uri.fromFile(
|
Uri.fromFile(
|
||||||
@ -82,9 +82,9 @@ class DownloadService : Service() {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if (downloadType in listOf(DownloadType.AUDIO, DownloadType.AUDIO_VIDEO)) {
|
else if (downloadType in listOf(DownloadType.AUDIO, DownloadType.AUDIO_VIDEO)) {
|
||||||
audioDownloadId = downloadManagerRequest(
|
audioDownloadId = downloadManagerRequest(
|
||||||
getString(R.string.audio),
|
videoName,
|
||||||
getString(R.string.downloading),
|
getString(R.string.downloading),
|
||||||
audioUrl,
|
audioUrl,
|
||||||
Uri.fromFile(
|
Uri.fromFile(
|
||||||
|
Loading…
Reference in New Issue
Block a user