refactor: Migrate file-based data storage to database
This commit is contained in:
@@ -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 ---
|
||||
|
||||
@@ -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 = {}
|
||||
|
||||
Reference in New Issue
Block a user