Allow combined +- in header rows
This commit is contained in:
parent
ba32473f06
commit
d0d3d5b09a
@ -95,6 +95,8 @@ class Config(object):
|
|||||||
ROOT = os.environ.get("ROOT") or "/home/kae/music"
|
ROOT = os.environ.get("ROOT") or "/home/kae/music"
|
||||||
ROWS_FROM_ZERO = True
|
ROWS_FROM_ZERO = True
|
||||||
SCROLL_TOP_MARGIN = 3
|
SCROLL_TOP_MARGIN = 3
|
||||||
|
SECTION_ENDINGS = ("-", "+-", "-+")
|
||||||
|
SECTION_STARTS = ("+", "+-", "-+")
|
||||||
SONGFACTS_ON_NEXT = False
|
SONGFACTS_ON_NEXT = False
|
||||||
START_GAP_WARNING_THRESHOLD = 300
|
START_GAP_WARNING_THRESHOLD = 300
|
||||||
TEXT_NO_TRACK_NO_NOTE = "[Section header]"
|
TEXT_NO_TRACK_NO_NOTE = "[Section header]"
|
||||||
|
|||||||
@ -618,7 +618,7 @@ class PlaylistModel(QAbstractTableModel):
|
|||||||
Process possible section timing directives embeded in header
|
Process possible section timing directives embeded in header
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if rat.note.endswith("+"):
|
if rat.note.endswith(Config.SECTION_STARTS):
|
||||||
return self.start_of_timed_section_header(rat)
|
return self.start_of_timed_section_header(rat)
|
||||||
|
|
||||||
elif rat.note.endswith("="):
|
elif rat.note.endswith("="):
|
||||||
@ -1445,7 +1445,7 @@ class PlaylistModel(QAbstractTableModel):
|
|||||||
for row_number in range(rat.row_number + 1, len(self.playlist_rows)):
|
for row_number in range(rat.row_number + 1, len(self.playlist_rows)):
|
||||||
row_rat = self.playlist_rows[row_number]
|
row_rat = self.playlist_rows[row_number]
|
||||||
if self.is_header_row(row_number):
|
if self.is_header_row(row_number):
|
||||||
if row_rat.note.endswith("-"):
|
if row_rat.note.endswith(Config.SECTION_ENDINGS):
|
||||||
return (
|
return (
|
||||||
f"{rat.note[:-1].strip()} "
|
f"{rat.note[:-1].strip()} "
|
||||||
f"[{count} tracks, {ms_to_mmss(duration)} unplayed]"
|
f"[{count} tracks, {ms_to_mmss(duration)} unplayed]"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user