Added duration to songs

This commit is contained in:
Kasper Rynning-Tønnesen
2017-02-15 14:49:43 +01:00
parent 41b14437cf
commit b1d1b0764d
6 changed files with 31 additions and 7 deletions

View File

@@ -154,6 +154,13 @@ var Helper = {
return Math.floor(Math.random() * (max - min)) + min;
},
secondsToOther: function(seconds){
var time = seconds;
var minutes = Math.floor(time/60);
time = time - (minutes * 60);
return [minutes, time];
},
rgbToHsl: function(arr, light){
r = arr[0];
g = arr[1];

View File

@@ -843,6 +843,9 @@ var List = {
}
attr = ".vote-container";
del_attr = "del";
var _temp_duration = Helper.secondsToOther(_song_info.duration);
song.find(".card-duration").text(Helper.pad(_temp_duration[0]) + ":" + Helper.pad(_temp_duration[1]));
}else if(!list){
song.find(".vote-text").text(_song_info.duration);