diff --git a/app/src/main/kotlin/me/rhunk/snapenhance/ui/manager/sections/downloads/DownloadsSection.kt b/app/src/main/kotlin/me/rhunk/snapenhance/ui/manager/sections/downloads/DownloadsSection.kt index 1514d8ea..5c1ab34e 100644 --- a/app/src/main/kotlin/me/rhunk/snapenhance/ui/manager/sections/downloads/DownloadsSection.kt +++ b/app/src/main/kotlin/me/rhunk/snapenhance/ui/manager/sections/downloads/DownloadsSection.kt @@ -229,6 +229,7 @@ class DownloadsSection : Section() { } //open FilledIconButton(onClick = { + if (download.outputFile == null) return@FilledIconButton val fileType = runCatching { context.androidContext.contentResolver.openInputStream(Uri.parse(download.outputFile))?.use { input -> FileType.fromInputStream(input) diff --git a/core/src/main/kotlin/me/rhunk/snapenhance/features/impl/downloader/MediaDownloader.kt b/core/src/main/kotlin/me/rhunk/snapenhance/features/impl/downloader/MediaDownloader.kt index b8233079..cf0dbdc9 100644 --- a/core/src/main/kotlin/me/rhunk/snapenhance/features/impl/downloader/MediaDownloader.kt +++ b/core/src/main/kotlin/me/rhunk/snapenhance/features/impl/downloader/MediaDownloader.kt @@ -364,6 +364,14 @@ class MediaDownloader : MessagingRuleFeature("MediaDownloader", MessagingRuleTyp selectedChapters.remove(which) } } + setNegativeButton("Cancel") { dialog, _ -> dialog.dismiss() } + setNeutralButton("Download all") { _, _ -> + provideDownloadManagerClient( + mediaIdentifier = paramMap["STORY_ID"].toString(), + downloadSource = MediaDownloadSource.PUBLIC_STORY, + mediaAuthor = storyName + ).downloadDashMedia(playlistUrl, 0, null) + } setPositiveButton("Download") { dialog, which -> val groups = mutableListOf>() var currentGroup = mutableListOf()