diff options
author | owner <owner@DeeDee-Laptop> | 2012-11-21 22:04:26 -0800 |
---|---|---|
committer | owner <owner@DeeDee-Laptop> | 2012-11-21 22:04:26 -0800 |
commit | d638f35850ab86304d39373121f4d512abbbcfdc (patch) | |
tree | 5cb2da10d0039d08a83efc1105b124df89854130 | |
parent | 2a4a56f035a57fa6a2a38718a1ca5023f361b0b9 (diff) | |
download | dsub-d638f35850ab86304d39373121f4d512abbbcfdc.tar.gz dsub-d638f35850ab86304d39373121f4d512abbbcfdc.tar.bz2 dsub-d638f35850ab86304d39373121f4d512abbbcfdc.zip |
Duration string now shows hours instead of > 100 minutes
-rw-r--r-- | subsonic-android/src/github/daneren2005/dsub/util/Util.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/util/Util.java b/subsonic-android/src/github/daneren2005/dsub/util/Util.java index 7616964b..497df90c 100644 --- a/subsonic-android/src/github/daneren2005/dsub/util/Util.java +++ b/subsonic-android/src/github/daneren2005/dsub/util/Util.java @@ -462,10 +462,17 @@ public final class Util { return null; } - int minutes = seconds / 60; + int hours = seconds / 3600; + int minutes = (seconds / 60) % 60; int secs = seconds % 60; - StringBuilder builder = new StringBuilder(6); + StringBuilder builder = new StringBuilder(7); + if(hours > 0) { + builder.append(hours).append(":"); + if(minutes < 10) { + builder.append("0"); + } + } builder.append(minutes).append(":"); if (secs < 10) { builder.append("0"); |