Bug 302485

Summary: Recently played applet shows meaningless last played times
Product: [Applications] amarok Reporter: robert marshall <robert>
Component: Context View/Current TrackAssignee: Amarok Developers <amarok-bugs-dist>
Status: RESOLVED FIXED    
Severity: normal CC: lfranchi, maddiemadan, simon.esneault, vianasw
Priority: NOR    
Version: 2.7.0   
Target Milestone: later   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In: 2.8
Attachments: screenshot of last played applet
screenshot of recent played applet

Description robert marshall 2012-06-25 06:23:59 UTC
If I set amarok to stop playing after this track, when the track completes the recently played applet appears, the tracks in it are correct but a large number of them claim to have been played within the last minute. If I scroll down some way in the list the last played time will go stright from 'played in the last minute' to 'played n hours ago' where the n is also incorrect. It is currently showing me as having listened to some tracks 3 hours ago and then 6 hours ago - but I've not listened to anything (since the most recent tracks) since last nightc 8 hours ago

Reproducible: Always

Steps to Reproduce:
1.play track 
2.set amarok to stop playing after this track
3. when track complete examine the recently played applet



I have noticed this bug before - it is not new to the beta
Comment 1 robert marshall 2012-06-25 06:27:25 UTC
Created attachment 72106 [details]
screenshot of last played applet

shows 5 tracks played in the last minute (there are a lot more than that which it claims I have listened to in that period!)
Comment 2 Myriam Schweingruber 2012-06-25 08:42:51 UTC
Robert: Amarok 2.5 was released over 6months ago, you shouldn't be using the beta anymore :) But I assume you mean 2.6 beta, right?
Comment 3 robert marshall 2012-06-25 10:15:39 UTC
I do - sorry about that! corrected!
Comment 4 Mayank Madan 2012-12-01 06:28:09 UTC
Cant reproduce this in v2.6.0-421-gf66a306.
Comment 5 robert marshall 2012-12-01 09:57:00 UTC
I can't replicate this bug in 2.6 either, I think it can be closed!
Comment 6 robert marshall 2012-12-01 10:05:08 UTC
No it's still there in 2.6 but with times not quite so meaningless - I replicated it by stop after current track, then play the next track and select stop after that. When it stops I have
last track  - within the last minute
(track-1) - 7 minutes ago
(track-2) - within the last minute
(track-3) - 3 minutes ago

it looks as if the previous tracks aren't updated between the two showing of the applet
Comment 7 Myriam Schweingruber 2012-12-01 11:21:43 UTC
(In reply to comment #6)
> No it's still there in 2.6 but with times not quite so meaningless - I
> replicated it by stop after current track, then play the next track and
> select stop after that. When it stops I have
> last track  - within the last minute
> (track-1) - 7 minutes ago
> (track-2) - within the last minute
> (track-3) - 3 minutes ago
> 
> it looks as if the previous tracks aren't updated between the two showing of
> the applet

I currently can't reproduce this either with 2.6-git which is ahead of your version. We will release a beta version of Amarok 2.7 in about a week, could you please then test again? Leaving this in WAITINGFORINFO until it can be tested.
Comment 8 robert marshall 2012-12-22 13:38:46 UTC
I'm still seeing this in 2.6.90 - I've current got around 30 tracks which I've listened to in the last minute (apparently!) and among that list (not at the beginning or the end) 2 tracks I've listened to 1 min and 3 minutes ago
Comment 9 Myriam Schweingruber 2012-12-22 18:34:45 UTC
Thank you for your feedback.
Comment 10 Myriam Schweingruber 2013-04-11 09:02:55 UTC
What with Amarok 2.7?
Comment 11 robert marshall 2013-04-11 12:50:37 UTC
Created attachment 78799 [details]
screenshot of recent played applet

I'm afraid the problem is still there. I had to scroll down a bit to get to the incorrect bit. Does it wrap after an hour?
All ok until I got to tracks around an hour before when it shows something I listened to last night, lots of tracks between not shown - the 'Round the Horne' in there _twice_ with incorrect times - the Robyn Archer and the one after were also from last night (both c8pm yesterday) - I ran the test at around 10:30am today
Comment 12 Myriam Schweingruber 2013-04-12 05:42:00 UTC
Thank you for the feedback.
Comment 13 Konrad Zemek 2013-07-26 16:19:25 UTC
Git commit 5bfcf25fa06fc09c9bc951c7f9bf05dc5f6d66a9 by Konrad Zemek.
Committed on 23/07/2013 at 09:55.
Pushed by kzemek into branch 'master'.

Reimplement RecentlyPlayedListWidget

Rewrote RecentlyPlayedListWidget from the basics. There was a major
inconsistency in this widget, where tracks were added to it if they were
recently played at all, but the time shown was the "Last Played"
statistic which is only updated after whole song is played. This
caused gravely incorrect data to be displayed (see bug 302485).

There were two different methods of solving the inconsistency: focusing
on the "Last Played" time, and adding songs to the widget only if the
"Last Played" changed; and focusing on recent plays completely
disregarding "Last Played". I opted for the latter as I felt it fits the
widget's nature better.

Because we can't rely on already available data, the widget needs to do
its own housekeeping. It saves its data on shutdown, to be restored
on next startup. One other major benefit of this approach is that
widget's data remains correct even if collections change, while
previously tracks from removed collections would disappear.

Finally, I added the feature to add tracks to playlist directly from the
widget, provided that the track exists.
Related: bug 279263, bug 296090
FIXED-IN: 2.8
REVIEW: 111655

M  +6    -0    ChangeLog
M  +156  -139  src/context/widgets/RecentlyPlayedListWidget.cpp
M  +51   -15   src/context/widgets/RecentlyPlayedListWidget.h

http://commits.kde.org/amarok/5bfcf25fa06fc09c9bc951c7f9bf05dc5f6d66a9