mirror of
https://gitlab.com/parroquia-san-leandro/cancionero-web.git
synced 2026-01-28 13:07:58 +01:00
Página preparar-misa.html y fragmentos de canciones
This commit is contained in:
parent
c622a27e34
commit
434cbc1c25
10 changed files with 391 additions and 21 deletions
11
src/model.py
11
src/model.py
|
|
@ -49,6 +49,9 @@ class Song:
|
|||
return True
|
||||
return False
|
||||
|
||||
def first_chord(self):
|
||||
return next(filter(None, map(Verse.first_chord, self.verses)), None)
|
||||
|
||||
def has_audios(self):
|
||||
return len(self.audios) > 0
|
||||
|
||||
|
|
@ -72,6 +75,9 @@ class Verse:
|
|||
return True
|
||||
return False
|
||||
|
||||
def first_chord(self):
|
||||
return next(filter(None, map(Line.first_chord, self.lines)), None)
|
||||
|
||||
|
||||
class Line:
|
||||
ECHO_BEGIN = '<span class="echo">'
|
||||
|
|
@ -85,7 +91,7 @@ class Line:
|
|||
self.build()
|
||||
self.remove_brackets()
|
||||
assert len(self.chord_arr) == len(self.lyric_arr)
|
||||
self.zipped_arr = zip(self.chord_arr, self.lyric_arr)
|
||||
self.zipped_arr = list(zip(self.chord_arr, self.lyric_arr))
|
||||
|
||||
def __str__(self):
|
||||
return self.text
|
||||
|
|
@ -166,6 +172,9 @@ class Line:
|
|||
return True
|
||||
return False
|
||||
|
||||
def first_chord(self):
|
||||
return next((i["data"] for key in self.extras for i in self.extras[key] if i["type"] == "chord"), None)
|
||||
|
||||
|
||||
def chord_eng2lat(text, transpose = 0):
|
||||
return Chord.CHORDS_LAT[(Chord.ENG_INDEX[text] + transpose + len(Chord.CHORDS_LAT)) % len(Chord.CHORDS_LAT)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue