Replace the committed channels/<slug>.json files as the runtime source of truth with a local SQLite database at the repo root (clipwright.db), overridable via CLIPWRIGHT_DB. Existing JSON profiles are imported once on first bootstrap, then the store is authoritative. - add clipwright/storage/channel_profiles.py (stdlib sqlite3, WAL + lock) - add Profile/TitleRules/ThumbnailRules.to_dict() for round-tripping - load_profile/list_profiles read the store; channels_dir stays a file seam - /api/channels CRUD plus import/export endpoints - untrack channels/*.json, ignore the DB files - seed a temp DB in tests/conftest.py
72 lines
2.9 KiB
Python
72 lines
2.9 KiB
Python
"""Seed data for the channel-profile store, mirroring ``channels/*.json``.
|
|
|
|
The runtime source of truth moved into SQLite, so the integration tests seed
|
|
the temp database from here via ``profiles.save_profile`` instead of relying on
|
|
the (now git-ignored) ``channels/*.json`` files. Values match those files
|
|
exactly because existing prompt/validator tests assert on them.
|
|
"""
|
|
|
|
SEED = {
|
|
"cseea": {
|
|
"name": "cseea",
|
|
"language": "en",
|
|
"tone": "nostalgic and calm; curious, never hype",
|
|
"title_rules": {
|
|
"max_chars": 60,
|
|
"mobile_chars": 38,
|
|
"banned_patterns": ["in this video", "tutorial", "let's play", "how to"],
|
|
"keyword_position": "start",
|
|
"number_policy": "avoid",
|
|
"required_signal": "curiosity",
|
|
"banned_openers": ["Exploring", "Building", "Playing", "A look at"],
|
|
},
|
|
"hook_patterns": [
|
|
"this shouldn't be possible in Alpha",
|
|
"the mechanic Mojang forgot to remove",
|
|
"you were never supposed to see this",
|
|
"I broke the world in one block",
|
|
],
|
|
"hook_style": ("visual impossibility at frame 0; show the glitch before any words"),
|
|
"description_template": "{hook}\n\nFull video: {link}\n\n#minecraft #alpha #retro",
|
|
"links": ["https://www.youtube.com/@cseea"],
|
|
"thumbnail": {
|
|
"role_order": ["curiosity", "emotion", "technical"],
|
|
"palette": ["mossy green", "cobblestone grey", "torch orange"],
|
|
"presenter_photo": False,
|
|
},
|
|
"default_postiz_integration_id": None,
|
|
"published_video_history": [],
|
|
},
|
|
"pedro": {
|
|
"name": "Pedro Bento",
|
|
"language": "en",
|
|
"tone": "technical, direct, engineering-focused",
|
|
"title_rules": {
|
|
"max_chars": 70,
|
|
"mobile_chars": 42,
|
|
"banned_patterns": ["in this video", "for beginners", "quick tip"],
|
|
"keyword_position": "start",
|
|
"number_policy": "allow",
|
|
"required_signal": "consequence",
|
|
"banned_openers": ["Explaining", "Discussing", "Talking about"],
|
|
},
|
|
"hook_patterns": [
|
|
"it crashes the moment you resize",
|
|
"watch the benchmark number change",
|
|
"the bug that survived three rewrites",
|
|
"this one syscall cost 40% throughput",
|
|
],
|
|
"hook_style": (
|
|
"show the working demo or the bug first, then state the stake in one line"
|
|
),
|
|
"description_template": "{hook}\n\nChapters and source: {link}\n\n#c #linux #systems",
|
|
"links": ["https://github.com/pbento"],
|
|
"thumbnail": {
|
|
"role_order": ["technical", "curiosity", "emotion"],
|
|
"palette": ["terminal black", "signal amber", "trace red"],
|
|
"presenter_photo": True,
|
|
},
|
|
"default_postiz_integration_id": None,
|
|
"published_video_history": [],
|
|
},
|
|
}
|