Compare commits
No commits in common. "a8a38fa5b7850bea29e9142e49ddf8b1b7d53462" and "5ed7b822e1c7bf970f1d647d1b7d0dd28c5b86c2" have entirely different histories.
a8a38fa5b7
...
5ed7b822e1
@ -129,13 +129,13 @@ class Playdates(dbtables.PlaydatesTable):
|
||||
) -> Sequence["Playdates"]:
|
||||
"""
|
||||
Return a list of the last limit playdates for this track, sorted
|
||||
latest to earliest.
|
||||
earliest to latest.
|
||||
"""
|
||||
|
||||
return session.scalars(
|
||||
Playdates.select()
|
||||
.where(Playdates.track_id == track_id)
|
||||
.order_by(Playdates.lastplayed.desc())
|
||||
.order_by(Playdates.lastplayed.asc())
|
||||
.limit(limit)
|
||||
).all()
|
||||
|
||||
|
||||
@ -32,7 +32,6 @@ import obswebsocket # type: ignore
|
||||
|
||||
# App imports
|
||||
from classes import (
|
||||
ApplicationError,
|
||||
Col,
|
||||
MusicMusterSignals,
|
||||
)
|
||||
@ -1282,10 +1281,10 @@ class PlaylistModel(QAbstractTableModel):
|
||||
# Show subtotal
|
||||
for row_number in range(rat.row_number - 1, -1, -1):
|
||||
row_rat = self.playlist_rows[row_number]
|
||||
if self.is_header_row(row_number) or row_number == 0:
|
||||
if row_rat.note.endswith(Config.SECTION_STARTS) or row_number == 0:
|
||||
if self.is_header_row(row_number):
|
||||
if row_rat.note.endswith(Config.SECTION_STARTS):
|
||||
# If we are playing this section, also
|
||||
# calculate end time when all tracks are played.
|
||||
# calculate end time if all tracks are played.
|
||||
end_time_str = ""
|
||||
if (
|
||||
track_sequence.current
|
||||
@ -1324,8 +1323,9 @@ class PlaylistModel(QAbstractTableModel):
|
||||
unplayed_count += 1
|
||||
duration += row_rat.duration
|
||||
|
||||
# We should never get here
|
||||
raise ApplicationError("Error in section_subtotal_header()")
|
||||
# We should only get here if there were no rows in section (ie,
|
||||
# this was row zero)
|
||||
return Config.SUBTOTAL_ON_ROW_ZERO
|
||||
|
||||
def selection_is_sortable(self, row_numbers: list[int]) -> bool:
|
||||
"""
|
||||
@ -1559,7 +1559,7 @@ class PlaylistModel(QAbstractTableModel):
|
||||
"<br>".join(
|
||||
[
|
||||
a.lastplayed.strftime(Config.LAST_PLAYED_TOOLTIP_DATE_FORMAT)
|
||||
for a in playdates
|
||||
for a in reversed(playdates)
|
||||
]
|
||||
)
|
||||
)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user