changed viewcount notation

This commit is contained in:
Christian Schabesberger 2016-03-04 14:16:02 +01:00
parent 9548dfabd6
commit 2318ad2bde
1 changed files with 10 additions and 2 deletions

View File

@ -125,12 +125,14 @@ class VideoInfoItemViewCreator {
int minutes = duration / 60; int minutes = duration / 60;
int seconds = duration % 60; int seconds = duration % 60;
//handle days
if(days > 0) { if(days > 0) {
output = Integer.toString(days) + ":"; output = Integer.toString(days) + ":";
} }
// handle hours
if(hours > 0 || !output.isEmpty()) { if(hours > 0 || !output.isEmpty()) {
if(hours > 0) { if(hours > 0) {
if(hours >= 10) { if(hours >= 10 || output.isEmpty()) {
output += Integer.toString(minutes); output += Integer.toString(minutes);
} else { } else {
output += "0" + Integer.toString(minutes); output += "0" + Integer.toString(minutes);
@ -140,9 +142,10 @@ class VideoInfoItemViewCreator {
} }
output += ":"; output += ":";
} }
//handle minutes
if(minutes > 0 || !output.isEmpty()) { if(minutes > 0 || !output.isEmpty()) {
if(minutes > 0) { if(minutes > 0) {
if(minutes >= 10) { if(minutes >= 10 || output.isEmpty()) {
output += Integer.toString(minutes); output += Integer.toString(minutes);
} else { } else {
output += "0" + Integer.toString(minutes); output += "0" + Integer.toString(minutes);
@ -153,6 +156,11 @@ class VideoInfoItemViewCreator {
output += ":"; output += ":";
} }
//handle seconds
if(output.isEmpty()) {
output += "0:";
}
if(seconds >= 10) { if(seconds >= 10) {
output += Integer.toString(seconds); output += Integer.toString(seconds);
} else { } else {