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

last played column #8211

Closed
mixxxbot opened this issue Aug 22, 2022 · 11 comments
Closed

last played column #8211

mixxxbot opened this issue Aug 22, 2022 · 11 comments

Comments

@mixxxbot
Copy link
Collaborator

Reported by: naught101
Date: 2015-09-01T05:13:46Z
Status: Fix Committed
Importance: Wishlist
Launchpad Issue: lp1490818
Tags: easy, library


Could we have a "last played" column in the library? Just with the date and time of last play.

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2016-07-03T09:11:39Z


#974

@mixxxbot
Copy link
Collaborator Author

Commented by: rryan
Date: 2018-09-20T17:54:25Z


Due to lack of progress, marking Triaged and clearing assignee. Feel free to revert if it is in fact still in progress :).

@mixxxbot
Copy link
Collaborator Author

Commented by: ywwg
Date: 2020-04-16T01:34:47Z


I might resurrect this (for 2.4), it would be super useful to sort a crate by "last time played"

@mixxxbot
Copy link
Collaborator Author

Commented by: ywwg
Date: 2020-04-16T03:03:11Z


so after reading the discussion on the pull request, it sounds like:

  • on startup, we blast through the history playlists and build a temporary table of track id and last played time
  • when building the basetrackcache (?), we get last played times from that table and pair it with the rest of the data for the track so that I can have a TrackPointer->getLastPlayedTime call
  • when a history playlist is updated, we update the temporary table and base track cache

creating the last played table is quick and easy:

SELECT 
  track_id,
  MAX(pl_datetime_added)
FROM
  PlaylistTracks
WHERE pl_datetime_added != ""
GROUP BY
  track_id
;

Regenerating values for updated trackids is similarly super fast, so we don't need to have any complex logic -- the db does all the work.

I'm not sure how to join the temporary last-played table with the base track cache though. It looks like the last played time should be in track.h somewhere? Or do I have to do a custom in-memory table for the whole library and every crate? I forget how data is set up so it populates the views.

@mixxxbot
Copy link
Collaborator Author

Commented by: ywwg
Date: 2020-04-16T03:24:27Z


Should it be part of the library_cache_view created in mixxxlibraryfeature.cpp?

@mixxxbot
Copy link
Collaborator Author

Commented by: Be-ing
Date: 2020-04-16T03:39:45Z


Launchpad isn't a great medium for in depth discussion. Do you want to start a Zulip topic on this?

I'm wondering if it might be a good idea to explicitly track each timestamp a track is played in the database.

@mixxxbot
Copy link
Collaborator Author

Commented by: ywwg
Date: 2020-04-16T04:37:12Z


huh, somehow it works automatically! good enough I guess.

@mixxxbot
Copy link
Collaborator Author

Commented by: ywwg
Date: 2020-04-16T13:31:31Z


One thing I don't like about Zulip is that discussions and decisions disappear in the noise, whereas bugs and PRs are more easily referenced, bookmarked, and tracked.

We already record each timestamp in the history playlists so that information already exists. I'm not sure how that affects this specific feature request.

@mixxxbot
Copy link
Collaborator Author

Commented by: ywwg
Date: 2020-04-16T21:00:10Z


#2670

@mixxxbot
Copy link
Collaborator Author

Commented by: Be-ing
Date: 2021-11-13T23:00:36Z


#3140
#3457

@mixxxbot
Copy link
Collaborator Author

Issue closed with status Fix Committed.

@mixxxbot mixxxbot transferred this issue from another repository Aug 24, 2022
@mixxxbot mixxxbot added this to the 2.4.0 milestone Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant