v0.1.10 - In the middle of working on getting admin api working
This commit is contained in:
@@ -10,8 +10,8 @@
|
||||
#include <stdint.h>
|
||||
#include "ginxsom.h"
|
||||
|
||||
// Database path
|
||||
#define DB_PATH "db/ginxsom.db"
|
||||
// Use global database path from main.c
|
||||
extern char g_db_path[];
|
||||
|
||||
// Check if NIP-94 metadata emission is enabled
|
||||
int nip94_is_enabled(void) {
|
||||
@@ -19,7 +19,7 @@ int nip94_is_enabled(void) {
|
||||
sqlite3_stmt* stmt;
|
||||
int rc, enabled = 1; // Default enabled
|
||||
|
||||
rc = sqlite3_open_v2(DB_PATH, &db, SQLITE_OPEN_READONLY, NULL);
|
||||
rc = sqlite3_open_v2(g_db_path, &db, SQLITE_OPEN_READONLY, NULL);
|
||||
if (rc) {
|
||||
return 1; // Default enabled on DB error
|
||||
}
|
||||
@@ -50,7 +50,7 @@ int nip94_get_origin(char* out, size_t out_size) {
|
||||
sqlite3_stmt* stmt;
|
||||
int rc;
|
||||
|
||||
rc = sqlite3_open_v2(DB_PATH, &db, SQLITE_OPEN_READONLY, NULL);
|
||||
rc = sqlite3_open_v2(g_db_path, &db, SQLITE_OPEN_READONLY, NULL);
|
||||
if (rc == SQLITE_OK) {
|
||||
const char* sql = "SELECT value FROM config WHERE key = 'cdn_origin'";
|
||||
rc = sqlite3_prepare_v2(db, sql, -1, &stmt, NULL);
|
||||
|
||||
Reference in New Issue
Block a user