mirror of
https://github.com/Myzel394/Alibi.git
synced 2025-06-18 23:05:26 +02:00
fix: Improve BatchesFolders; concatenate video files
This commit is contained in:
parent
89baa35ed7
commit
8c391a7504
@ -10,7 +10,7 @@ class AudioBatchesFolder(
|
||||
override val context: Context,
|
||||
override val type: BatchType,
|
||||
override val customFolder: DocumentFile? = null,
|
||||
override val subfolderName: String = ".recordings",
|
||||
override val subfolderName: String = ".audio_recordings",
|
||||
) : BatchesFolder(
|
||||
context,
|
||||
type,
|
||||
@ -37,21 +37,22 @@ class AudioBatchesFolder(
|
||||
recordingStart: LocalDateTime,
|
||||
extension: String,
|
||||
disableCache: Boolean,
|
||||
) {
|
||||
if (!disableCache && checkIfOutputAlreadyExists(recordingStart, extension)) {
|
||||
return
|
||||
}
|
||||
|
||||
val filePaths = getBatchesForFFmpeg()
|
||||
): String {
|
||||
val outputFile = getOutputFileForFFmpeg(
|
||||
date = recordingStart,
|
||||
extension = extension,
|
||||
)
|
||||
|
||||
MediaConverter.concatenateAudioFiles(
|
||||
inputFiles = filePaths,
|
||||
outputFile = outputFile,
|
||||
).await()
|
||||
if (disableCache || checkIfOutputAlreadyExists(recordingStart, extension)) {
|
||||
val filePaths = getBatchesForFFmpeg()
|
||||
|
||||
MediaConverter.concatenateAudioFiles(
|
||||
inputFiles = filePaths,
|
||||
outputFile = outputFile,
|
||||
).await()
|
||||
}
|
||||
|
||||
return outputFile
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
@ -115,7 +115,7 @@ abstract class BatchesFolder(
|
||||
recordingStart: LocalDateTime,
|
||||
extension: String,
|
||||
disableCache: Boolean = false,
|
||||
)
|
||||
): String
|
||||
|
||||
fun exportFolderForSettings(): String {
|
||||
return when (type) {
|
||||
|
@ -10,7 +10,7 @@ class VideoBatchesFolder(
|
||||
override val context: Context,
|
||||
override val type: BatchesFolder.BatchType,
|
||||
override val customFolder: DocumentFile? = null,
|
||||
override val subfolderName: String = ".recordings",
|
||||
override val subfolderName: String = ".video_recordings",
|
||||
) : BatchesFolder(
|
||||
context,
|
||||
type,
|
||||
@ -34,21 +34,22 @@ class VideoBatchesFolder(
|
||||
recordingStart: LocalDateTime,
|
||||
extension: String,
|
||||
disableCache: Boolean
|
||||
) {
|
||||
if (!disableCache && checkIfOutputAlreadyExists(recordingStart, extension)) {
|
||||
return
|
||||
}
|
||||
|
||||
val filePaths = getBatchesForFFmpeg()
|
||||
): String {
|
||||
val outputFile = getOutputFileForFFmpeg(
|
||||
date = recordingStart,
|
||||
extension = extension,
|
||||
)
|
||||
|
||||
MediaConverter.concatenateAudioFiles(
|
||||
inputFiles = filePaths,
|
||||
outputFile = outputFile,
|
||||
).await()
|
||||
if (disableCache || !checkIfOutputAlreadyExists(recordingStart, extension)) {
|
||||
val filePaths = getBatchesForFFmpeg()
|
||||
|
||||
MediaConverter.concatenateVideoFiles(
|
||||
inputFiles = filePaths,
|
||||
outputFile = outputFile,
|
||||
).await()
|
||||
}
|
||||
|
||||
return outputFile
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
Loading…
x
Reference in New Issue
Block a user