| | |
| | | return engine.ModelExists() |
| | | } |
| | | |
| | | func (s *EngineService) HasAnyInstalledModel() bool { |
| | | return model.HasAnyUsableModel() |
| | | } |
| | | |
| | | func (s *EngineService) GetStatus() map[string]interface{} { |
| | | s.mu.RLock() |
| | | defer s.mu.RUnlock() |
| | |
| | | |
| | | func (s *EngineService) SetStatus(status, hardwareInfo, lastError string) { |
| | | s.mu.Lock() |
| | | defer s.mu.Unlock() |
| | | s.status = status |
| | | s.hardwareInfo = hardwareInfo |
| | | s.lastError = lastError |
| | | s.mu.Unlock() |
| | | |
| | | if s.app != nil { |
| | | s.app.Event.Emit("engine:status", map[string]interface{}{ |
| | | "status": status, |
| | | "hardwareInfo": hardwareInfo, |
| | | "error": lastError, |
| | | }) |
| | | } |
| | | } |
| | | |
| | | // DownloadModel downloads the ASR model with progress events. |