Fix CronJob model API compatibility and register BackHandler in SettingsScreen

This commit is contained in:
Hy4ri committed 2026-06-16 00:21:31 +03:00
1 parent 9b2aeae836
commit 3ff148f6d0
3 files changed
+28 -5

No files matched your search

@@ -3,8 +3,25 @@ package com.m57.hermescontrol.data.model
data class CronJob(
val id: String,
val name: String,
val schedule: String?,
val schedule: Any?,
val state: String?,
val last_run_status: String?,
val next_run: String?,
)
val schedule_display: String? = null,
val last_status: String? = null,
val next_run_at: String? = null,
) {
val scheduleText: String
get() =
when (schedule) {
is String -> schedule
is Map<*, *> -> (schedule["display"] as? String) ?: schedule_display ?: ""
else -> schedule_display ?: ""
}
val lastRunStatus: String
get() = last_run_status ?: last_status ?: ""
val nextRunTime: String
get() = next_run ?: next_run_at ?: ""
}