mirror of
https://github.com/Myzel394/Alibi.git
synced 2025-06-18 23:05:26 +02:00
feat: Add filename format to AppSettings
Signed-off-by: Myzel394 <50424412+Myzel394@users.noreply.github.com>
This commit is contained in:
parent
048e285f9c
commit
ee4529a9dc
@ -29,6 +29,8 @@ data class AppSettings(
|
||||
val theme: Theme = Theme.SYSTEM,
|
||||
val lastRecording: RecordingInformation? = null,
|
||||
|
||||
val filenameFormat: FilenameFormat = FilenameFormat.DATETIME_RELATIVE_START,
|
||||
|
||||
/// Recording information
|
||||
// 30 minutes
|
||||
val maxDuration: Long = 15 * 60 * 1000L,
|
||||
@ -67,6 +69,10 @@ data class AppSettings(
|
||||
return copy(lastRecording = lastRecording)
|
||||
}
|
||||
|
||||
fun setFilenameFormat(filenameFormat: FilenameFormat): AppSettings {
|
||||
return copy(filenameFormat = filenameFormat)
|
||||
}
|
||||
|
||||
fun setMaxDuration(duration: Long): AppSettings {
|
||||
if (duration < 60 * 1000L || duration > 10 * 24 * 60 * 60 * 1000L) {
|
||||
throw Exception("Max duration must be between 1 minute and 10 days")
|
||||
@ -124,14 +130,19 @@ data class AppSettings(
|
||||
))
|
||||
}
|
||||
|
||||
fun exportToString(): String {
|
||||
return Json.encodeToString(serializer(), this)
|
||||
}
|
||||
|
||||
enum class Theme {
|
||||
SYSTEM,
|
||||
LIGHT,
|
||||
DARK,
|
||||
}
|
||||
|
||||
fun exportToString(): String {
|
||||
return Json.encodeToString(serializer(), this)
|
||||
enum class FilenameFormat {
|
||||
DATETIME_ABSOLUTE_START,
|
||||
DATETIME_RELATIVE_START,
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
Loading…
x
Reference in New Issue
Block a user