Bug 267380 - Total playlist length is not displayed correctly
Summary: Total playlist length is not displayed correctly
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Playlist (show other bugs)
Version: 2.4.1
Platform: Ubuntu Linux
: NOR minor
Target Milestone: 2.4.1
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-01 14:42 UTC by o_O_Tync
Modified: 2011-07-25 00:24 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 2.4.2
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description o_O_Tync 2011-03-01 14:42:26 UTC
Version:           2.4.0 (using KDE 4.6.0) 
OS:                Linux

In the statusbar, the playlist length says "7 783 tracks (14:53:10)", which means "(days, hours, minutes)" (approx. 3min per track)

If I replace it with a single artists's collection: "66 tracks (3:58:19)", which now means "(hours, minutes, seconds)"

This behaviour should be standardazied, like this: "[%dd] [%h:]%m:%s"

Reproducible: Always
Comment 1 Myriam Schweingruber 2011-06-04 12:16:47 UTC
This is an automated message from the triager:

Amarok 2.4.1 has been released on May 8 already. Could you please upgrade and test if you can still reproduce this bug?

Without feedback within a month we will close this bug as resolved.

Thank you for your understanding.
Comment 2 Kevin Funk 2011-06-05 23:05:59 UTC
*** Bug 273407 has been marked as a duplicate of this bug. ***
Comment 3 o_O_Tync 2011-06-13 22:58:56 UTC
The bug is still here: I have "7549 tracks (19:31:03)" (each of approx. 4min long). That gives "19 days, 31 hours, 03 minutes": info's correct, but not human-readable
Comment 4 Myriam Schweingruber 2011-06-19 13:02:37 UTC
Thank you for the feedback.
Comment 5 Sven Krohlas 2011-06-26 13:41:35 UTC
Git commit 1e1c902f56f8c704583e233f55986c20c78f8527 by Sven Krohlas.
Committed on 26/06/2011 at 15:35.
Pushed by krohlas into branch 'master'.

Correctly show playlist length for playlists > 1d

The limit is now 1 month, which should be enough for day to day usage. ;-)
BUG:267380
FIXED-IN:2.4.2

M  +2    -0    src/core/meta/support/MetaUtility.cpp     

http://commits.kde.org/amarok/1e1c902f56f8c704583e233f55986c20c78f8527

diff --git a/src/core/meta/support/MetaUtility.cpp b/src/core/meta/support/MetaUtility.cpp
index 6fceb0a..f409ff2 100644
--- a/src/core/meta/support/MetaUtility.cpp
+++ b/src/core/meta/support/MetaUtility.cpp
@@ -390,6 +390,8 @@ Meta::secToPrettyTime( int seconds )
 {
     if( seconds < 60 * 60 ) // one hour
         return QTime().addSecs( seconds ).toString( i18nc("the time format for a time length when the time is below 1 hour see QTime documentation.", "m:ss" ) );
+    else if( seconds >= 86400 ) // one day
+        return  QDateTime().addSecs( seconds ).toString( i18nc("the time format for a time length when the time is 1 day or above see QDateTime documentation.", "d:hh:mm:ss" ) );
     else
         return QTime().addSecs( seconds ).toString( i18nc("the time format for a time length when the time is 1 hour or above see QTime documentation.", "h:mm:ss" ) );
 }
Comment 6 Sam Lade 2011-07-25 00:24:36 UTC
Git commit 9cbd63a0c4aeff231e464e39dd5ff6d2685e49ee by Sam Lade.
Committed on 25/07/2011 at 01:18.
Pushed by lade into branch 'master'.

Display correct values for pretty times > 1 day

CCBUG:267380
CCBUG:273407

M  +9    -4    src/core/meta/support/MetaUtility.cpp

http://commits.kde.org/amarok/9cbd63a0c4aeff231e464e39dd5ff6d2685e49ee