mirror of
https://github.com/Myzel394/Alibi.git
synced 2025-06-18 23:05:26 +02:00
feat: Add now as filename format
Signed-off-by: Myzel394 <50424412+Myzel394@users.noreply.github.com>
This commit is contained in:
parent
ac0fd3fed2
commit
ffd1405a61
@ -143,6 +143,7 @@ data class AppSettings(
|
|||||||
enum class FilenameFormat {
|
enum class FilenameFormat {
|
||||||
DATETIME_ABSOLUTE_START,
|
DATETIME_ABSOLUTE_START,
|
||||||
DATETIME_RELATIVE_START,
|
DATETIME_RELATIVE_START,
|
||||||
|
DATETIME_NOW,
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
@ -183,6 +184,8 @@ data class RecordingInformation(
|
|||||||
AppSettings.FilenameFormat.DATETIME_RELATIVE_START -> LocalDateTime.now().minusSeconds(
|
AppSettings.FilenameFormat.DATETIME_RELATIVE_START -> LocalDateTime.now().minusSeconds(
|
||||||
getFullDuration() / 1000
|
getFullDuration() / 1000
|
||||||
)
|
)
|
||||||
|
|
||||||
|
AppSettings.FilenameFormat.DATETIME_NOW -> LocalDateTime.now()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -257,6 +257,7 @@ abstract class BatchesFolder(
|
|||||||
onProgress: (Float?) -> Unit = {},
|
onProgress: (Float?) -> Unit = {},
|
||||||
): String {
|
): String {
|
||||||
val disableCache = disableCache ?: (type != BatchType.INTERNAL)
|
val disableCache = disableCache ?: (type != BatchType.INTERNAL)
|
||||||
|
val date = recording.getStartDateForFilename(filenameFormat)
|
||||||
|
|
||||||
if (!disableCache && checkIfOutputAlreadyExists(
|
if (!disableCache && checkIfOutputAlreadyExists(
|
||||||
recording.recordingStart,
|
recording.recordingStart,
|
||||||
@ -279,7 +280,7 @@ abstract class BatchesFolder(
|
|||||||
val filePaths = getBatchesForFFmpeg()
|
val filePaths = getBatchesForFFmpeg()
|
||||||
|
|
||||||
val outputFile = getOutputFileForFFmpeg(
|
val outputFile = getOutputFileForFFmpeg(
|
||||||
date = recording.getStartDateForFilename(filenameFormat),
|
date = date,
|
||||||
extension = recording.fileExtension,
|
extension = recording.fileExtension,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@ import androidx.compose.foundation.verticalScroll
|
|||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
import androidx.compose.material.icons.automirrored.filled.TextSnippet
|
import androidx.compose.material.icons.automirrored.filled.TextSnippet
|
||||||
import androidx.compose.material.icons.filled.AccessTime
|
import androidx.compose.material.icons.filled.AccessTime
|
||||||
|
import androidx.compose.material.icons.filled.Circle
|
||||||
import androidx.compose.material.icons.filled.Timelapse
|
import androidx.compose.material.icons.filled.Timelapse
|
||||||
import androidx.compose.material3.Button
|
import androidx.compose.material3.Button
|
||||||
import androidx.compose.material3.ButtonDefaults
|
import androidx.compose.material3.ButtonDefaults
|
||||||
@ -178,6 +179,17 @@ private fun SelectionSheet(
|
|||||||
updateValue(AppSettings.FilenameFormat.DATETIME_RELATIVE_START)
|
updateValue(AppSettings.FilenameFormat.DATETIME_RELATIVE_START)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
HorizontalDivider()
|
||||||
|
|
||||||
|
SelectionButton(
|
||||||
|
label = stringResource(R.string.ui_settings_option_filenameFormat_action_now_label),
|
||||||
|
explanation = stringResource(R.string.ui_settings_option_filenameFormat_action_now_explanation),
|
||||||
|
icon = Icons.Default.Circle,
|
||||||
|
onClick = {
|
||||||
|
updateValue(AppSettings.FilenameFormat.DATETIME_RELATIVE_START)
|
||||||
|
},
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -231,4 +231,6 @@
|
|||||||
<string name="ui_settings_option_filenameFormat_action_relativeStart_label">Recording start</string>
|
<string name="ui_settings_option_filenameFormat_action_relativeStart_label">Recording start</string>
|
||||||
<string name="ui_settings_option_filenameFormat_action_relativeStart_explanation">Use the time the actual recording starts at</string>
|
<string name="ui_settings_option_filenameFormat_action_relativeStart_explanation">Use the time the actual recording starts at</string>
|
||||||
<string name="ui_settings_option_filenameFormat_success">The new format will be used for future recordings</string>
|
<string name="ui_settings_option_filenameFormat_success">The new format will be used for future recordings</string>
|
||||||
|
<string name="ui_settings_option_filenameFormat_action_now_label">Save time</string>
|
||||||
|
<string name="ui_settings_option_filenameFormat_action_now_explanation">Use the time you saved the recording</string>
|
||||||
</resources>
|
</resources>
|
Loading…
x
Reference in New Issue
Block a user