mirror of
https://github.com/aniyomiorg/aniyomi.git
synced 2024-11-29 09:39:03 +03:00
fix downloading to internal storage
This commit is contained in:
parent
5ec79c79dc
commit
b72a24f867
3 changed files with 3 additions and 3 deletions
|
@ -235,7 +235,7 @@ class LocalAnimeSource(
|
|||
val second = duration.toInt() / 2
|
||||
|
||||
val coverFilename = coverPath.toFFmpegString(context)
|
||||
FFmpegKit.execute("-ss $second -i \"${episodeFilename()}\" -frames 1 -q:v 2 \"$coverFilename\"")
|
||||
FFmpegKit.execute("-ss $second -i \"${episodeFilename()}\" -frames 1 -q:v 2 \"$coverFilename\" -y")
|
||||
|
||||
if (File(coverPath).exists()) {
|
||||
anime.thumbnail_url = coverPath
|
||||
|
|
|
@ -503,7 +503,7 @@ class AnimeDownloader(
|
|||
val videoFile = tmpDir.findFile("$filename.mp4")
|
||||
?: tmpDir.createFile("$filename.mp4")!!
|
||||
val ffmpegFilename = { videoFile.uri.toFFmpegString(context) }
|
||||
val ffmpegOptions = FFmpegKitConfig.parseArguments(headerOptions + " -i '${video.videoUrl}' -c copy \"${ffmpegFilename()}\"")
|
||||
val ffmpegOptions = FFmpegKitConfig.parseArguments(headerOptions + " -i '${video.videoUrl}' -c copy \"${ffmpegFilename()}\" -y")
|
||||
val ffprobeCommand = { file: String, ffprobeHeaders: String? ->
|
||||
FFmpegKitConfig.parseArguments("${ffprobeHeaders?.plus(" ") ?: ""}-v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 \"$file\"")
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ fun String.toFFmpegString(context: Context): String {
|
|||
}
|
||||
|
||||
fun Uri.toFFmpegString(context: Context): String {
|
||||
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && this.scheme == "content") {
|
||||
FFmpegKitConfig.getSafParameter(context, this, "rw")
|
||||
} else {
|
||||
this.path!!
|
||||
|
|
Loading…
Reference in a new issue