(key: string, value: string)
| 65 | } |
| 66 | |
| 67 | static set(key: string, value: string): void { |
| 68 | this.init(); |
| 69 | if (!this.db) return; |
| 70 | |
| 71 | try { |
| 72 | const stmt = this.db.prepare(` |
| 73 | INSERT OR REPLACE INTO config (key, value, updated_at) |
| 74 | VALUES (?, ?, CURRENT_TIMESTAMP) |
| 75 | `); |
| 76 | stmt.run(key, value); |
| 77 | } catch (error) { |
| 78 | console.error("保存Komari配置失败:", error); |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | // 获取所有配置 |
| 83 | static getAll(): { [key: string]: string } { |
no test coverage detected