refactor: Migrate file-based data storage to database

This commit is contained in:
2026-02-22 10:23:40 -05:00
parent b4058f9f1f
commit 51b98c9399
9 changed files with 108 additions and 80 deletions

View File

@@ -35,7 +35,8 @@ if not API_KEY: raise ValueError("CRITICAL ERROR: GEMINI_API_KEY not found in en
DATA_DIR = os.path.join(BASE_DIR, "data")
PROJECTS_DIR = os.path.join(DATA_DIR, "projects")
PERSONAS_DIR = os.path.join(DATA_DIR, "personas")
PERSONAS_FILE = os.path.join(PERSONAS_DIR, "personas.json")
# PERSONAS_FILE is deprecated — persona data is now stored in the Persona DB table.
# PERSONAS_FILE = os.path.join(PERSONAS_DIR, "personas.json")
FONTS_DIR = os.path.join(DATA_DIR, "fonts")
# --- ENSURE DIRECTORIES EXIST ---

View File

@@ -129,11 +129,8 @@ def load_json(path):
return json.load(open(path, 'r')) if os.path.exists(path) else None
def create_default_personas():
# Persona data is now stored in the Persona DB table; ensure the directory exists for sample files.
if not os.path.exists(config.PERSONAS_DIR): os.makedirs(config.PERSONAS_DIR)
if not os.path.exists(config.PERSONAS_FILE):
try:
with open(config.PERSONAS_FILE, 'w') as f: json.dump({}, f, indent=2)
except: pass
def get_length_presets():
presets = {}