Select the single active video profile through endpoint publication

This commit is contained in:
Mikei386
2026-09-29 13:16:41 +02:00
parent 7d6facaefa
commit e851b2f3ea
8 changed files with 33 additions and 12 deletions
+6 -2
View File
@@ -36,7 +36,7 @@ class Endpoint:
def rows(self):
rows=self.profiles.status()['profiles']
with self.lock:enabled=set(self.config['enabled_profiles'])
return [dict(p,enabled=p['id'] in enabled) for p in rows]
return [dict(p,enabled=(p['id']==self.video.selected if self.video else False) if p['kind']=='video' else p['id'] in enabled) for p in rows]
def status(self):
rows=self.rows();worker=self.worker.status();job=self.images.status()['job'];counts={}
for key,kind in [('llm','chat'),('image','image'),('tts','audio'),('stt','stt')]:
@@ -61,8 +61,12 @@ class Endpoint:
rows=self.rows()
row=next((p for p in rows if p['id']==data['id']),None)
if not row:raise ValueError('Profil nicht gefunden.')
if row['kind']=='video':raise ValueError('Videoprofil in der Übersicht auswählen; Video nutzt eine exklusive Auswahl.')
if data['enabled'] and not row['runnable']:raise ValueError('Profil nicht ausführbar: '+' '.join(row['blockers']))
if row['kind']=='video':
if not self.video:raise ValueError('Video-Verwaltung nicht eingerichtet.')
if data['enabled']:self.video.select(row['id'])
elif self.video.selected==row['id']:self.video.select(None)
return self.status()
with self.lock:
enabled=set(self.config['enabled_profiles'])
if data['enabled']: