From dd16258a9cdcd4817ec56e2d7cc70fa4e710fc32 Mon Sep 17 00:00:00 2001 From: jmir1 Date: Tue, 3 May 2022 13:55:43 +0200 Subject: [PATCH] add error logging when ffmpeg download fails --- .../eu/kanade/tachiyomi/data/download/AnimeDownloader.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/download/AnimeDownloader.kt b/app/src/main/java/eu/kanade/tachiyomi/data/download/AnimeDownloader.kt index 4b355198e..63da1b8e2 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/download/AnimeDownloader.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/download/AnimeDownloader.kt @@ -497,7 +497,11 @@ class AnimeDownloader( // TODO: Support other file formats here as well (ffprobe or something, idk) val ffmpegOptions = FFmpegKitConfig.parseArguments(headerOptions + " -i '${video.videoUrl}' -c copy \"$escapedFilename\"") val executeCallback = ExecuteCallback { - if (it.state != SessionState.COMPLETED) tmpDir.findFile("$filename.mp4")?.delete() + if (it.state != SessionState.COMPLETED) { + tmpDir.findFile("$filename.mp4")?.delete() + it.failStackTrace?.let { trace -> logcat(LogPriority.ERROR) { trace } } + throw Exception(it.failStackTrace ?: "Error in ffmpeg download") + } } var duration = 0L var nextLineIsDuration = false