feat: Increase max duration to 10 days; Closes #25

This commit is contained in:
Myzel394 2023-10-22 15:25:32 +02:00
parent 3345ee6eb8
commit 41af9004a2
No known key found for this signature in database
GPG Key ID: 79CC92F37B3E1A2B
2 changed files with 6 additions and 5 deletions

View File

@ -144,6 +144,7 @@ data class LastRecording(
@Serializable
data class AudioRecorderSettings(
// 30 minutes
val maxDuration: Long = 30 * 60 * 1000L,
// 60 seconds
val intervalDuration: Long = 60 * 1000L,
@ -266,8 +267,8 @@ data class AudioRecorderSettings(
}
fun setMaxDuration(duration: Long): AudioRecorderSettings {
if (duration < 60 * 1000L || duration > 24 * 60 * 60 * 1000L) {
throw Exception("Max duration must be between 1 minute and 1 hour")
if (duration < 60 * 1000L || duration > 10 * 24 * 60 * 60 * 1000L) {
throw Exception("Max duration must be between 1 minute and 10 days")
}
if (duration < intervalDuration) {

View File

@ -65,10 +65,10 @@ fun MaxDurationTile() {
updateValue(newTimeInSeconds * 1000L)
},
config = DurationConfig(
timeFormat = DurationFormat.MM_SS,
timeFormat = DurationFormat.HH_MM,
currentTime = settings.audioRecorderSettings.maxDuration / 1000,
minTime = 60,
maxTime = 24 * 60 * 60,
maxTime = 10 * 24 * 60 * 60,
)
)
SettingsTile(
@ -95,7 +95,7 @@ fun MaxDurationTile() {
ExampleListRoulette(
items = AudioRecorderSettings.EXAMPLE_MAX_DURATIONS,
onItemSelected = ::updateValue,
) {maxDuration ->
) { maxDuration ->
Text(formatDuration(maxDuration))
}
}