mirror of
https://github.com/Myzel394/Alibi.git
synced 2025-06-19 07:15:25 +02:00
fix: Fix custom BatchesFolder
This commit is contained in:
parent
79ba18630c
commit
18195c9893
@ -62,7 +62,7 @@ data class BatchesFolder(
|
|||||||
.map {
|
.map {
|
||||||
FFmpegKitConfig.getSafParameterForRead(
|
FFmpegKitConfig.getSafParameterForRead(
|
||||||
context,
|
context,
|
||||||
customFolder!!.findFile(it.name!!)!!.uri
|
it.uri,
|
||||||
)!!
|
)!!
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -82,7 +82,10 @@ data class BatchesFolder(
|
|||||||
BatchType.INTERNAL -> File(getInternalFolder(), "$name.$extension").absolutePath
|
BatchType.INTERNAL -> File(getInternalFolder(), "$name.$extension").absolutePath
|
||||||
BatchType.CUSTOM -> FFmpegKitConfig.getSafParameterForWrite(
|
BatchType.CUSTOM -> FFmpegKitConfig.getSafParameterForWrite(
|
||||||
context,
|
context,
|
||||||
customFolder!!.createFile("audio/${extension}", "${name}.${extension}")!!.uri
|
getCustomDefinedFolder().createFile(
|
||||||
|
"audio/${extension}",
|
||||||
|
"${name}.${extension}"
|
||||||
|
)!!.uri
|
||||||
)!!
|
)!!
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -97,9 +100,7 @@ data class BatchesFolder(
|
|||||||
fun deleteRecordings() {
|
fun deleteRecordings() {
|
||||||
when (type) {
|
when (type) {
|
||||||
BatchType.INTERNAL -> getInternalFolder().deleteRecursively()
|
BatchType.INTERNAL -> getInternalFolder().deleteRecursively()
|
||||||
BatchType.CUSTOM -> getCustomDefinedFolder().listFiles().forEach {
|
BatchType.CUSTOM -> customFolder?.findFile(subfolderName)?.delete()
|
||||||
it.delete()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,8 +67,6 @@ class AudioRecorderModel : ViewModel() {
|
|||||||
override fun onServiceConnected(className: ComponentName, service: IBinder) {
|
override fun onServiceConnected(className: ComponentName, service: IBinder) {
|
||||||
recorderService =
|
recorderService =
|
||||||
((service as RecorderService.RecorderBinder).getService() as AudioRecorderService).also { recorder ->
|
((service as RecorderService.RecorderBinder).getService() as AudioRecorderService).also { recorder ->
|
||||||
recorder.clearAllRecordings()
|
|
||||||
|
|
||||||
// Init variables from us to the service
|
// Init variables from us to the service
|
||||||
recorder.onStateChange = { state ->
|
recorder.onStateChange = { state ->
|
||||||
recorderState = state
|
recorderState = state
|
||||||
@ -95,6 +93,8 @@ class AudioRecorderModel : ViewModel() {
|
|||||||
recorder.batchesFolder = batchesFolder ?: recorder.batchesFolder
|
recorder.batchesFolder = batchesFolder ?: recorder.batchesFolder
|
||||||
recorder.settings =
|
recorder.settings =
|
||||||
IntervalRecorderService.Settings.from(settings.audioRecorderSettings)
|
IntervalRecorderService.Settings.from(settings.audioRecorderSettings)
|
||||||
|
|
||||||
|
recorder.clearAllRecordings()
|
||||||
}.also {
|
}.also {
|
||||||
// Init UI from the service
|
// Init UI from the service
|
||||||
it.startRecording()
|
it.startRecording()
|
||||||
@ -122,8 +122,8 @@ class AudioRecorderModel : ViewModel() {
|
|||||||
|
|
||||||
fun startRecording(context: Context, settings: AppSettings) {
|
fun startRecording(context: Context, settings: AppSettings) {
|
||||||
runCatching {
|
runCatching {
|
||||||
context.unbindService(connection)
|
|
||||||
recorderService?.clearAllRecordings()
|
recorderService?.clearAllRecordings()
|
||||||
|
context.unbindService(connection)
|
||||||
}
|
}
|
||||||
|
|
||||||
notificationDetails = settings.notificationSettings.let {
|
notificationDetails = settings.notificationSettings.let {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user