INNER CODE UNIT · Python

_bootstrap_profiles

GHJJ123/brainrotguard · main.py:38

    def _bootstrap_profiles(self) -> None:
        """Ensure at least one profile exists. Auto-creates 'default' on first run."""
        profiles = self.video_store.get_profiles()
        if profiles:
            return  # Profiles already exist

        from web.helpers import AVATAR_ICONS, AVATAR_COLORS
        pin = self.config.web.pin if self.config.web else ""
        self.video_store.create_profile(
            "default", "Default", pin=pin,
            icon=random.choice(AVATAR_ICONS), color=random.choice(AVATAR_COLORS),
        )
        logger.info("Created default profile (PIN: %s)", "set" if pin else "none")

    async def setup(self) -> None:
        """Initialize all components."""
        db_path = self.config.database.path
        os.makedirs(os.path.dirname(db_path) or ".", exist_ok=True)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…