File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66#include < QThread>
77#include < QtDebug>
88
9-
109#ifdef __SQLITE3__
1110#include < sqlite3.h>
1211#endif // __SQLITE3__
@@ -2489,24 +2488,24 @@ QString TrackDAO::findLastTimeAddedToHistory(TrackId trackId) const {
24892488 if (m_lastAddedToHistoryQuery.lastQuery ().isEmpty ()) {
24902489 m_lastAddedToHistoryQuery = QSqlQuery (m_database);
24912490 m_lastAddedToHistoryQuery.prepare (
2492- " SELECT MAX(PlaylistTracks.pl_datetime_added) "
2493- " FROM PlaylistTracks "
2494- " JOIN Playlists ON PlaylistTracks.playlist_id = Playlists.id "
2495- " WHERE PlaylistTracks.track_id = :id "
2496- " AND Playlists.hidden = " + QString::number (PlaylistDAO:: PLHT_SET_LOG )
2497- );
2491+ " SELECT MAX(PlaylistTracks.pl_datetime_added) "
2492+ " FROM PlaylistTracks "
2493+ " JOIN Playlists ON PlaylistTracks.playlist_id = Playlists.id "
2494+ " WHERE PlaylistTracks.track_id = :id "
2495+ " AND Playlists.hidden = " +
2496+ QString::number (PlaylistDAO:: PLHT_SET_LOG ) );
24982497 }
24992498
25002499 m_lastAddedToHistoryQuery.bindValue (" :id" , trackId.toVariant ());
2501-
2500+
25022501 if (!m_lastAddedToHistoryQuery.exec ()) {
25032502 LOG_FAILED_QUERY (m_lastAddedToHistoryQuery) << " Failed to find last time added to history for track" << trackId;
25042503 return QString ();
25052504 }
2506-
2505+
25072506 if (m_lastAddedToHistoryQuery.next ()) {
25082507 return m_lastAddedToHistoryQuery.value (0 ).toString ();
25092508 }
2510-
2509+
25112510 return QString ();
25122511}
You can’t perform that action at this time.
0 commit comments