bambuddy/backend/app/models/orca_base_cache.py
maziggy edf244c469 Add local profiles — import OrcaSlicer presets without Bambu Cloud (#310)
Users who use OrcaSlicer without Bambu Cloud can now import slicer
presets directly into Bambuddy. Supports .orca_filament, .bbscfg,
.bbsflmt, .zip, and .json exports with automatic inheritance resolution
via OrcaSlicer's GitHub base profiles (cached with 7-day TTL).
2026-02-09 17:00:02 +01:00

22 lines
828 B
Python

"""Cache model for OrcaSlicer base profiles fetched from GitHub."""
from datetime import datetime
from sqlalchemy import DateTime, Index, String, Text, func
from sqlalchemy.orm import Mapped, mapped_column
from backend.app.core.database import Base
class OrcaBaseProfile(Base):
"""Cached OrcaSlicer base profile from GitHub for inheritance resolution."""
__tablename__ = "orca_base_profiles"
id: Mapped[int] = mapped_column(primary_key=True)
name: Mapped[str] = mapped_column(String(300))
profile_type: Mapped[str] = mapped_column(String(20)) # filament, machine, process
setting: Mapped[str] = mapped_column(Text) # Full JSON
fetched_at: Mapped[datetime] = mapped_column(DateTime, server_default=func.now())
__table_args__ = (Index("ix_orca_base_profiles_name", "name", unique=True),)