Clean project layout and fix release workflow
Some checks failed
build-windows-exe / build (push) Failing after 1m13s

This commit is contained in:
messypy
2026-07-27 23:01:24 +09:00
parent 3ff33e40e3
commit dd165d9301
80 changed files with 2908 additions and 5661 deletions

View File

@@ -19,6 +19,7 @@ type RuntimeState struct {
LastOCRText string
LastTranslate string
CurrentWorld string
CurrentWorldSince string
}
var runtimeState = &RuntimeState{}
@@ -84,6 +85,29 @@ func SetCurrentWorld(v string) {
_ = persistRuntimeState()
}
func SetCurrentWorldVisit(world string, since time.Time) {
runtimeState.mu.Lock()
runtimeState.CurrentWorld = world
if since.IsZero() {
runtimeState.CurrentWorldSince = ""
} else {
runtimeState.CurrentWorldSince = since.Format(time.RFC3339)
}
runtimeState.mu.Unlock()
_ = persistRuntimeState()
}
func SetCurrentWorldSince(v time.Time) {
runtimeState.mu.Lock()
if v.IsZero() {
runtimeState.CurrentWorldSince = ""
} else {
runtimeState.CurrentWorldSince = v.Format(time.RFC3339)
}
runtimeState.mu.Unlock()
_ = persistRuntimeState()
}
func SnapshotRuntime() RuntimeState {
runtimeState.mu.RLock()
defer runtimeState.mu.RUnlock()
@@ -111,6 +135,7 @@ func persistRuntimeState() error {
"ocr": s.LastOCRText,
"translate": s.LastTranslate,
"world": s.CurrentWorld,
"world_since": s.CurrentWorldSince,
"updated_at": time.Now().Format(time.RFC3339),
})
}