diff --git a/app/models.py b/app/models.py index 59bd66e..d746ccf 100644 --- a/app/models.py +++ b/app/models.py @@ -134,7 +134,7 @@ class Playdates(Base): __tablename__ = "playdates" id: int = Column(Integer, primary_key=True, autoincrement=True) - lastplayed = Column(DateTime, index=True, default=None) + lastplayed: datetime = Column(DateTime, index=True) track_id = Column(Integer, ForeignKey("tracks.id")) track: "Tracks" = relationship("Tracks", back_populates="playdates") diff --git a/app/musicmuster.py b/app/musicmuster.py index 2bac939..b5eaad0 100755 --- a/app/musicmuster.py +++ b/app/musicmuster.py @@ -1967,9 +1967,8 @@ class DbDialog(QDialog): track_text = ( f"{track.title} - {track.artist} " f"[{helpers.ms_to_mmss(track.duration)}] " + f"({helpers.get_relative_date(last_played)})" ) - if show_last_played: - track_text += f"({helpers.get_relative_date(last_played)})" t.setText(track_text) t.setData(Qt.ItemDataRole.UserRole, track) self.ui.matchList.addItem(t)