Fix production issues: add matplotlib dep, fix get_db calls, resolve ESLint

- Add matplotlib>=3.7.0 to requirements-podcast.txt (B-roll requires it)
- Fix research.py and exa_provider.py using get_session_for_user() instead of broken Depends(get_db)
- Fix BrollInfoPanel.tsx: call useScriptEditor hook unconditionally
- Add debug logging to avatar endpoint for troubleshooting
This commit is contained in:
ajaysi
2026-04-20 12:55:25 +05:30
parent 7f7279f903
commit 625dd550d3
6 changed files with 40 additions and 33 deletions

View File

@@ -314,11 +314,14 @@ class ExaResearchProvider(BaseProvider):
def track_exa_usage(self, user_id: str, cost: float):
"""Track Exa API usage after successful call."""
from services.database import get_db
from services.database import get_session_for_user
from services.subscription import PricingService
from sqlalchemy import text
db = next(get_db())
db = get_session_for_user(user_id)
if not db:
logger.warning(f"[track_exa_usage] Could not get DB session for user {user_id}")
return
try:
pricing_service = PricingService(db)
current_period = pricing_service.get_current_billing_period(user_id)

View File

@@ -8,11 +8,11 @@ import numpy as np
from pathlib import Path
from dataclasses import dataclass, field
from typing import Optional
from PIL import Image, ImageDraw, ImageFont
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
from PIL import Image, ImageDraw, ImageFont
from moviepy import (
VideoFileClip, ImageClip, CompositeVideoClip,
concatenate_videoclips,