fix: bump kotlinx-datetime to 0.7.1, scope ExperimentalTime opt-in to saveEvents

This commit is contained in:
herel committed 2026-07-08 17:14:56 +02:00
1 parent 11c0a92421
commit b61b6408f3
2 files changed
+2 -2

No files matched your search

@@ -7,7 +7,6 @@ import kotlin.time.ExperimentalTime
import kotlinx.serialization.builtins.ListSerializer
import kotlinx.serialization.json.Json
@OptIn(ExperimentalTime::class)
class ScheduleCache(private val settings: Settings) {
private val json = Json { ignoreUnknownKeys = true }
@@ -19,6 +18,7 @@ class ScheduleCache(private val settings: Settings) {
private fun typeFilterKey(account: String) = "filters_typefilter_$account"
private fun timestampKey(account: String) = "cached_events_timestamp_$account"
@OptIn(ExperimentalTime::class)
fun saveEvents(account: String, events: List<Event>) {
settings.putString(eventsKey(account), json.encodeToString(eventListSerializer, events))
settings.putLong(timestampKey(account), Clock.System.now().toEpochMilliseconds())