Merge branch 'main' into narl.io

This commit is contained in:
nvrl committed 2026-02-18 14:34:30 +01:00
commit 454297881a
2 files changed
+30 -20

No files matched your search

+18 -19
View File
@@ -37,26 +37,25 @@ class Command(BaseCommand):
if not created:
# Sync missing settings from JSON to DB without overwriting existing keys
db_settings = banner.settings or {}
json_settings = data.get('settings', {})
json_schema = data.get('schema', [])
updated = False
# Sync missing settings
for key, value in json_settings.items():
if key not in db_settings:
db_settings[key] = value
updated = True
# Always sync schema as it represents the UI structure
if banner.schema != json_schema:
banner.schema = json_schema
updated = True
if updated:
banner.settings = db_settings
banner.save()
db_settings = banner.settings or {}
json_settings = data.get('settings', {})
json_schema = data.get('schema', [])
updated = False
# Sync missing settings
for key, value in json_settings.items():
if key not in db_settings:
db_settings[key] = value
updated = True
# Always sync schema as it represents the UI structure
if banner.schema != json_schema:
banner.schema = json_schema
updated = True
if updated:
banner.settings = db_settings
banner.save()
self.stdout.write(self.style.SUCCESS(f"Synced new settings for banner '{slug}' from {filename}"))
else:
self.stdout.write(self.style.SUCCESS(f"Created new banner '{slug}' from {filename}"))
+12 -1
View File
@@ -4,5 +4,16 @@
"description": "A matrix-style falling code banner using the username.",
"settings": {
"opacity": 0.6
}
},
"schema": [
{
"key": "opacity",
"label": "Overall Opacity",
"type": "slider",
"min": 0.1,
"max": 1.0,
"step": 0.05,
"description": "Transparency of the matrix code effect."
}
]
}