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

Method get

komari/komari.ts:49–65  ·  view source on GitHub ↗
(key: string, defaultValue?: string)

Source from the content-addressed store, hash-verified

47 }
48
49 static get(key: string, defaultValue?: string): string {
50 this.init();
51 if (!this.db) return defaultValue || "";
52
53 try {
54 const stmt = this.db.prepare("SELECT value FROM config WHERE key = ?");
55 const row = stmt.get(key) as { value: string } | undefined;
56
57 if (row) {
58 return row.value;
59 }
60 } catch (error) {
61 console.error("读取Komari配置失败:", error);
62 }
63
64 return defaultValue || "";
65 }
66
67 static set(key: string, value: string): void {
68 this.init();

Callers 3

cleanupMethod · 0.45
makeRequestFunction · 0.45
handleKomariRequestFunction · 0.45

Calls 2

initMethod · 0.95
errorMethod · 0.80

Tested by

no test coverage detected