iOS App (complete rebuild): - Audited all fitness API endpoints against live responses - Models match exact API field names (snapshot_ prefixes, UUID strings) - FoodEntry uses computed properties (foodName, calories, etc.) wrapping snapshot fields - Flexible Int/Double decoding for all numeric fields - AI assistant with raw JSON state management (JSONSerialization, not Codable) - Home dashboard with custom background, frosted glass calorie widget - Fitness: Today/Templates/Goals/Foods tabs - Food search with recent + all sections - Meal sections with colored accent bars, swipe to delete - 120fps ProMotion, iOS 17+ @Observable Podcast/Media Service: - FastAPI backend for podcast RSS + local audiobook folders - Shows, episodes, playback progress, queue management - RSS feed fetching with feedparser + ETag support - Local folder scanning with mutagen for audio metadata - HTTP Range streaming for local audio files - Playback events logging (play/pause/seek/complete) - Reuses brain's PostgreSQL + Redis - media_ prefixed tables Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
36 lines
971 B
Python
36 lines
971 B
Python
"""Media service configuration — all from environment variables."""
|
|
|
|
import os
|
|
|
|
# ── Database ──
|
|
DATABASE_URL = os.environ.get(
|
|
"DATABASE_URL",
|
|
"postgresql+asyncpg://brain:brain@brain-db:5432/brain",
|
|
)
|
|
DATABASE_URL_SYNC = DATABASE_URL.replace("+asyncpg", "")
|
|
|
|
# ── Redis ──
|
|
REDIS_URL = os.environ.get("REDIS_URL", "redis://brain-redis:6379/0")
|
|
|
|
# ── Local audio ──
|
|
LOCAL_AUDIO_PATH = os.environ.get("LOCAL_AUDIO_PATH", "/audiobooks")
|
|
|
|
# ── Worker ──
|
|
FEED_FETCH_INTERVAL = int(os.environ.get("FEED_FETCH_INTERVAL", "1800"))
|
|
|
|
# ── Service ──
|
|
PORT = int(os.environ.get("PORT", "8400"))
|
|
DEBUG = os.environ.get("DEBUG", "").lower() in ("1", "true")
|
|
|
|
# ── Audio extensions ──
|
|
AUDIO_EXTENSIONS = {".mp3", ".m4a", ".ogg", ".opus", ".flac"}
|
|
|
|
# ── Content types ──
|
|
CONTENT_TYPES = {
|
|
".mp3": "audio/mpeg",
|
|
".m4a": "audio/mp4",
|
|
".ogg": "audio/ogg",
|
|
".opus": "audio/opus",
|
|
".flac": "audio/flac",
|
|
}
|