Session editor and live sessions!

This commit is contained in:
marc
2025-03-21 19:42:43 +01:00
parent 6c83d11e5b
commit ac54453b7f
54 changed files with 1247 additions and 173 deletions

View File

@@ -7,11 +7,12 @@ from folkugat_web.model import temes as model
def create_tema(title: str = "") -> model.Tema:
return temes_w.insert_tema(tema=model.Tema(title=title))
new_tema = model.Tema(title=title, hidden=False).with_ngrams()
return temes_w.insert_tema(tema=new_tema)
def delete_tema(tema_id: int) -> None:
tema = temes_w.delete_tema(tema_id=tema_id)
temes_w.delete_tema(tema_id=tema_id)
def update_title(tema_id: int, title: str) -> model.Tema:
@@ -20,9 +21,7 @@ def update_title(tema_id: int, title: str) -> model.Tema:
if tema is None:
raise ValueError(f"No tune found with tema_id = {tema_id}!")
new_tema = dataclasses.replace(tema, title=title)
new_tema.compute_ngrams()
new_tema = dataclasses.replace(tema, title=title).with_ngrams()
temes_w.update_tema(tema=new_tema, con=con)
return new_tema