Show hours on timestamp.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 29 May 2013 18:46:26 +0000 (20:46 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 30 May 2013 10:10:04 +0000 (12:10 +0200)
src/main/java/net/pterodactylus/sonitus/data/filter/TimeCounterFilter.java

index 1c53d55..b584a48 100644 (file)
@@ -122,7 +122,7 @@ public class TimeCounterFilter extends DummyFilter {
        private void updateTimestamp(boolean now) {
                long timestamp = getMillis() / 1000;
                if (now || (lastTimestamp.get() != timestamp)) {
-                       super.metadataUpdated(parentMetadata.get().comment(String.format("%02d:%02d", timestamp / 60, timestamp % 60)));
+                       super.metadataUpdated(parentMetadata.get().comment(String.format("%s%02d:%02d", (timestamp >= 3600) ? String.format("%d:", timestamp / 3600) : "" , (timestamp % 3600) / 60, timestamp % 60)));
                        lastTimestamp.set(timestamp);
                }
        }