Adjustment
This commit is contained in:
parent
4420c61a4f
commit
98179263f8
@ -37,11 +37,12 @@ class EncodeDaemon(val referenceId: String, val work: EncodeWork, val daemonInte
|
||||
}
|
||||
|
||||
suspend fun runUsingWorkItem(): Int {
|
||||
if (!File(work.outFile).parentFile.exists()) {
|
||||
File(work.outFile).parentFile.mkdirs()
|
||||
val outFile = File(work.outFile)
|
||||
if (!outFile.parentFile.exists()) {
|
||||
outFile.parentFile.mkdirs()
|
||||
}
|
||||
val adjustedArgs = listOf(
|
||||
"-hide_banner", "-i", "'${work.inFile}'", *work.arguments.toTypedArray(), "'${work.outFile}'",
|
||||
"-hide_banner", "-i", File(work.inFile).absolutePath, *work.arguments.toTypedArray(), outFile.absolutePath,
|
||||
"-progress", "pipe:1"
|
||||
) + if (EncodeEnv.allowOverwrite) listOf("-y") else emptyList()
|
||||
logger.info { "$referenceId @ ${work.workId} ${adjustedArgs.joinToString(" ")}" }
|
||||
|
||||
@ -15,11 +15,12 @@ class ExtractDaemon(val referenceId: String, val work: ExtractWork, val daemonIn
|
||||
|
||||
|
||||
suspend fun runUsingWorkItem(): Int {
|
||||
if (!File(work.outFile).parentFile.exists()) {
|
||||
File(work.outFile).parentFile.mkdirs()
|
||||
val outFile = File(work.outFile)
|
||||
if (!outFile.parentFile.exists()) {
|
||||
outFile.parentFile.mkdirs()
|
||||
}
|
||||
val adjustedArgs = listOf(
|
||||
"-hide_banner", "-i", "'${work.inFile}'", *work.arguments.toTypedArray(), "'${work.outFile}'",
|
||||
"-hide_banner", "-i", File(work.inFile).absolutePath, *work.arguments.toTypedArray(), outFile.absolutePath,
|
||||
"-progress", "pipe:1"
|
||||
) + if (EncodeEnv.allowOverwrite) listOf("-y") else emptyList()
|
||||
logger.info { "$referenceId @ ${work.workId} ${adjustedArgs.joinToString(" ")}" }
|
||||
|
||||
Loading…
Reference in New Issue
Block a user