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