mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-06 21:21:15 -07:00
VERY EXPERIMENTAL CHANGES!
History logging is now under the hood. Disabled by default. Write new database tables and upgrade old ones. Provide more detail to get_activity.
This commit is contained in:
parent
f5233ffed2
commit
9152fa01af
9 changed files with 596 additions and 89 deletions
|
@ -249,4 +249,28 @@ function humanTime(seconds) {
|
|||
|
||||
String.prototype.toProperCase = function () {
|
||||
return this.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});
|
||||
};
|
||||
};
|
||||
|
||||
function millisecondsToMinutes(ms, roundToMinute) {
|
||||
|
||||
console.log("Ms: " + ms)
|
||||
if (ms > 0) {
|
||||
seconds = ms / 1000;
|
||||
minutes = seconds / 60;
|
||||
|
||||
if (roundToMinute) {
|
||||
output = Math.round(minutes, 0)
|
||||
} else {
|
||||
minutesFloor = Math.floor(minutes);
|
||||
secondsReal = Math.round((seconds - (minutesFloor * 60)),0);
|
||||
if (secondsReal < 10) {
|
||||
secondsReal = '0' + secondsReal;
|
||||
}
|
||||
output = minutesFloor + ':' + secondsReal;
|
||||
}
|
||||
return output;
|
||||
} else {
|
||||
return '0';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue