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 theme: Theme = Theme.SYSTEM,
|
||||||
val lastRecording: RecordingInformation? = null,
|
val lastRecording: RecordingInformation? = null,
|
||||||
|
|
||||||
|
val filenameFormat: FilenameFormat = FilenameFormat.DATETIME_RELATIVE_START,
|
||||||
|
|
||||||
/// Recording information
|
/// Recording information
|
||||||
// 30 minutes
|
// 30 minutes
|
||||||
val maxDuration: Long = 15 * 60 * 1000L,
|
val maxDuration: Long = 15 * 60 * 1000L,
|
||||||
@ -67,6 +69,10 @@ data class AppSettings(
|
|||||||
return copy(lastRecording = lastRecording)
|
return copy(lastRecording = lastRecording)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun setFilenameFormat(filenameFormat: FilenameFormat): AppSettings {
|
||||||
|
return copy(filenameFormat = filenameFormat)
|
||||||
|
}
|
||||||
|
|
||||||
fun setMaxDuration(duration: Long): AppSettings {
|
fun setMaxDuration(duration: Long): AppSettings {
|
||||||
if (duration < 60 * 1000L || duration > 10 * 24 * 60 * 60 * 1000L) {
|
if (duration < 60 * 1000L || duration > 10 * 24 * 60 * 60 * 1000L) {
|
||||||
throw Exception("Max duration must be between 1 minute and 10 days")
|
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 {
|
enum class Theme {
|
||||||
SYSTEM,
|
SYSTEM,
|
||||||
LIGHT,
|
LIGHT,
|
||||||
DARK,
|
DARK,
|
||||||
}
|
}
|
||||||
|
|
||||||
fun exportToString(): String {
|
enum class FilenameFormat {
|
||||||
return Json.encodeToString(serializer(), this)
|
DATETIME_ABSOLUTE_START,
|
||||||
|
DATETIME_RELATIVE_START,
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user