MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / getAll

Method getAll

komari/komari.ts:83–101  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

81
82 // 获取所有配置
83 static getAll(): { [key: string]: string } {
84 this.init();
85 if (!this.db) return {};
86
87 try {
88 const stmt = this.db.prepare("SELECT key, value FROM config");
89 const rows = stmt.all() as { key: string; value: string }[];
90
91 const config: { [key: string]: string } = {};
92 rows.forEach((row) => {
93 config[row.key] = row.value;
94 });
95
96 return config;
97 } catch (error) {
98 console.error("读取所有Komari配置失败:", error);
99 return {};
100 }
101 }
102
103 // 删除配置
104 static delete(key: string): void {

Callers

nothing calls this directly

Calls 2

initMethod · 0.95
errorMethod · 0.80

Tested by

no test coverage detected