Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "Last Played" column to library #2670

Closed
wants to merge 27 commits into from
Closed

Conversation

ywwg
Copy link
Member

@ywwg ywwg commented Apr 16, 2020

https://bugs.launchpad.net/mixxx/+bug/1490818

This adds an artificial column (the product of a simple TEMPORARY VIEW query) that reports the last time a track was played according to the history playlists.

This mostly works, except if I delete an old history playlist sometimes the library view is slow to show the updated values.

@ywwg
Copy link
Member Author

ywwg commented Apr 16, 2020

Also, bindValue isn't work for some reason. I'll try it again but it keeps saying "parameter count mismatch" even though everything looks right.

@Be-ing Be-ing marked this pull request as draft April 16, 2020 21:16
@ywwg
Copy link
Member Author

ywwg commented Apr 16, 2020

pushed a change that tries to use bindValue but it fails. Can't figure out why, but the prepare statement seems to be returning false

VIEWs can't use params.
@ywwg
Copy link
Member Author

ywwg commented Apr 17, 2020

ok bindvalue works now

@ywwg ywwg marked this pull request as ready for review April 17, 2020 00:09
@Be-ing
Copy link
Contributor

Be-ing commented Apr 17, 2020

Build fails:

/home/be/sw/mixxx/src/library/lastplayedcache.cpp:70:9: error: non-void function 'fetchLastPlayedTime' should return a value [-Wreturn-type]
        return;
        ^
1 error generated.

src/track/track.cpp Outdated Show resolved Hide resolved
@Be-ing
Copy link
Contributor

Be-ing commented Apr 17, 2020

It works, cool! I'll let others review the implementation details.

src/library/lastplayedcache.cpp Outdated Show resolved Hide resolved
src/library/lastplayedcache.cpp Outdated Show resolved Hide resolved
src/library/lastplayedcache.h Outdated Show resolved Hide resolved
src/library/lastplayedcache.h Outdated Show resolved Hide resolved
src/library/lastplayedcache.h Outdated Show resolved Hide resolved
src/library/lastplayedcache.h Outdated Show resolved Hide resolved
src/library/mixxxlibraryfeature.cpp Outdated Show resolved Hide resolved
src/track/track.cpp Outdated Show resolved Hide resolved
@Be-ing Be-ing added this to the 2.4.0 milestone May 7, 2020
@daschuer
Copy link
Member

@ywwg
Copy link
Member Author

ywwg commented Jun 17, 2020

Fixed an issue where deleting a playlist did not correctly update the tables.

I also did a drive-by change to the trackdeleted signal, which had a "position" parameter that was never used.

@ywwg ywwg changed the title WIP: Add "Last Played" column to library Add "Last Played" column to library Jun 17, 2020
@@ -88,7 +88,7 @@ void BaseSqlTableModel::initSortColumnMapping() {
m_columnIndexBySortColumnId[TrackModel::SortColumnId::SORTCOLUMN_DATETIMEADDED] = fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_DATETIMEADDED);
m_columnIndexBySortColumnId
[TrackModel::SortColumnId::SORTCOLUMN_LASTPLAYEDDATETIME] =
fieldIndex(ColumnCache::COLUMN_LASTPLAYED_DATETIMEPLAYED);
fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_DATETIMEPLAYED);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commits in the history that do not even build are bad for git bisect. Redo and force push.

@ywwg
Copy link
Member Author

ywwg commented Oct 16, 2020

obsoleted by #3140

@ywwg ywwg closed this Oct 16, 2020
@ronso0 ronso0 removed this from the 2.4.0 milestone Nov 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

7 participants