feat: video fixing options
This commit is contained in:
parent
c2a10c233d
commit
10df1986e8
6 changed files with 112 additions and 3 deletions
|
@ -379,7 +379,7 @@ class DownloadsManager(private val context: Context) {
|
|||
|
||||
private const val RESERVED_CHARS = "|\\?*<\":>+[]/'"
|
||||
fun String?.findValidName(): String {
|
||||
return this?.filterNot { RESERVED_CHARS.contains(it) } ?: ""
|
||||
return this?.replace("/","_")?.filterNot { RESERVED_CHARS.contains(it) } ?: ""
|
||||
}
|
||||
|
||||
data class DownloadedType(
|
||||
|
|
|
@ -26,6 +26,7 @@ import ani.dantotsu.download.DownloadedType
|
|||
import ani.dantotsu.download.DownloadsManager
|
||||
import ani.dantotsu.download.DownloadsManager.Companion.getSubDirectory
|
||||
import ani.dantotsu.download.anime.AnimeDownloaderService.AnimeDownloadTask.Companion.getTaskName
|
||||
import ani.dantotsu.download.findValidName
|
||||
import ani.dantotsu.media.Media
|
||||
import ani.dantotsu.media.MediaType
|
||||
import ani.dantotsu.media.anime.AnimeWatchFragment
|
||||
|
@ -224,7 +225,7 @@ class AnimeDownloaderService : Service() {
|
|||
task.episode
|
||||
) ?: throw Exception("Failed to create output directory")
|
||||
|
||||
outputDir.findFile("${task.getTaskName()}.mkv")?.delete()
|
||||
outputDir.findFile("${task.getTaskName().findValidName()}.mkv")?.delete()
|
||||
val outputFile =
|
||||
outputDir.createFile("video/x-matroska", "${task.getTaskName()}.mkv")
|
||||
?: throw Exception("Failed to create output file")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue