Afegir control visual de les lletres per a partitures

This commit is contained in:
marc
2026-01-05 10:19:25 +01:00
parent c0624d1e56
commit 4e7a6b18d6
10 changed files with 65 additions and 12 deletions

View File

@@ -32,13 +32,16 @@ class LyricsText:
@classmethod
def from_lyrics(cls, lyrics: temes.Lyrics, max_cols: int = 3) -> Self:
# Use stored max_columns if available, otherwise use the provided max_cols
effective_max_cols = lyrics.max_columns if lyrics.max_columns is not None else max_cols
# Remove ~ characters before processing
paragraphs = [
LyricsParagraph(lines=par_str.splitlines())
LyricsParagraph(lines=[line.replace("~", "") for line in par_str.splitlines()])
for par_str in lyrics.content.split("\n\n") if par_str
]
return cls(lines=[
LyricsLine(paragraphs=list(line_pars))
for line_pars in batched(paragraphs, max_cols)
for line_pars in batched(paragraphs, effective_max_cols)
])
def hash(self) -> bytes:

View File

@@ -60,6 +60,7 @@ class Lyrics:
tema_id: int
title: str
content: str
max_columns: int | None = None
@dataclasses.dataclass