diff --git a/app/config.py b/app/config.py index 1d7a196..8c33418 100644 --- a/app/config.py +++ b/app/config.py @@ -95,6 +95,8 @@ class Config(object): ROOT = os.environ.get("ROOT") or "/home/kae/music" ROWS_FROM_ZERO = True SCROLL_TOP_MARGIN = 3 + SECTION_ENDINGS = ("-", "+-", "-+") + SECTION_STARTS = ("+", "+-", "-+") SONGFACTS_ON_NEXT = False START_GAP_WARNING_THRESHOLD = 300 TEXT_NO_TRACK_NO_NOTE = "[Section header]" diff --git a/app/playlistmodel.py b/app/playlistmodel.py index 71cb907..8fd89a7 100644 --- a/app/playlistmodel.py +++ b/app/playlistmodel.py @@ -618,7 +618,7 @@ class PlaylistModel(QAbstractTableModel): 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) elif rat.note.endswith("="): @@ -1445,7 +1445,7 @@ class PlaylistModel(QAbstractTableModel): for row_number in range(rat.row_number + 1, len(self.playlist_rows)): row_rat = self.playlist_rows[row_number] if self.is_header_row(row_number): - if row_rat.note.endswith("-"): + if row_rat.note.endswith(Config.SECTION_ENDINGS): return ( f"{rat.note[:-1].strip()} " f"[{count} tracks, {ms_to_mmss(duration)} unplayed]"