Compare commits
4 Commits
a8a38fa5b7
...
53664857c1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
53664857c1 | ||
|
|
c8b571b38f | ||
|
|
b3bd93d71c | ||
|
|
57ffa71c86 |
@ -50,7 +50,8 @@ class PlaydatesTable(Model):
|
||||
lastplayed: Mapped[dt.datetime] = mapped_column(index=True)
|
||||
track_id: Mapped[int] = mapped_column(ForeignKey("tracks.id"))
|
||||
track: Mapped["TracksTable"] = relationship(
|
||||
"TracksTable", back_populates="playdates"
|
||||
"TracksTable",
|
||||
back_populates="playdates",
|
||||
)
|
||||
|
||||
def __repr__(self) -> str:
|
||||
@ -103,7 +104,7 @@ class PlaylistRowsTable(Model):
|
||||
)
|
||||
|
||||
playlist: Mapped[PlaylistsTable] = relationship(back_populates="rows")
|
||||
track_id: Mapped[Optional[int]] = mapped_column(ForeignKey("tracks.id"))
|
||||
track_id: Mapped[Optional[int]] = mapped_column(ForeignKey("tracks.id", ondelete="CASCADE"))
|
||||
track: Mapped["TracksTable"] = relationship(
|
||||
"TracksTable",
|
||||
back_populates="playlistrows",
|
||||
|
||||
@ -22,6 +22,9 @@ filters:
|
||||
# module-name:
|
||||
# - function-name-1
|
||||
# - function-name-2
|
||||
musicmuster:
|
||||
- update_clocks
|
||||
- play_next
|
||||
|
||||
handlers:
|
||||
stderr:
|
||||
|
||||
@ -36,7 +36,6 @@ if DATABASE_URL is None:
|
||||
if "unittest" in sys.modules and "sqlite" not in DATABASE_URL:
|
||||
raise ValueError("Unit tests running on non-Sqlite database")
|
||||
db = DatabaseManager.get_instance(DATABASE_URL, engine_options=Config.ENGINE_OPTIONS).db
|
||||
db.create_all()
|
||||
|
||||
|
||||
# Database classes
|
||||
|
||||
@ -502,9 +502,7 @@ class Window(QMainWindow):
|
||||
)
|
||||
)
|
||||
file_menu.addSeparator()
|
||||
file_menu.addAction(
|
||||
self.create_action("Exit", self.close)
|
||||
) # Default action for closing
|
||||
file_menu.addAction(self.create_action("Exit", self.close))
|
||||
|
||||
# Playlist Menu
|
||||
playlist_menu = menu_bar.addMenu("&Playlist")
|
||||
@ -768,7 +766,7 @@ class Window(QMainWindow):
|
||||
|
||||
def create_playlist_tab(self, playlist: Playlists) -> int:
|
||||
"""
|
||||
Take the passed proxy model, create a playlist tab and
|
||||
Take the passed playlist, create a playlist tab and
|
||||
add tab to display. Return index number of tab.
|
||||
"""
|
||||
|
||||
|
||||
@ -1279,6 +1279,10 @@ class PlaylistModel(QAbstractTableModel):
|
||||
unplayed_count: int = 0
|
||||
duration: int = 0
|
||||
|
||||
if rat.row_number == 0:
|
||||
# Meaningless to have a subtotal on row 0
|
||||
return Config.SUBTOTAL_ON_ROW_ZERO
|
||||
|
||||
# Show subtotal
|
||||
for row_number in range(rat.row_number - 1, -1, -1):
|
||||
row_rat = self.playlist_rows[row_number]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user