fix #365 parsing media limit

This commit is contained in:
Erik 2014-05-22 09:22:58 -04:00
parent d42fc2eabf
commit 4f7e4ad65e
2 changed files with 9 additions and 2 deletions

View file

@ -1,5 +1,6 @@
var ChannelModule = require("./module");
var Config = require("../config");
var Utilities = require ("../utilities");
function OptionsModule(channel) {
ChannelModule.apply(this, arguments);
@ -120,7 +121,13 @@ OptionsModule.prototype.handleSetOptions = function (user, data) {
}
if ("maxlength" in data) {
var ml = parseInt(data.maxlength);
var ml = 0;
if (typeof data.maxlength !== "number") {
ml = Utilities.parseTime(data.maxlength);
} else {
ml = parseInt(data.maxlength);
}
if (isNaN(ml) || ml < 0) {
ml = 0;
}

View file

@ -176,7 +176,7 @@
},
root.parseTime = function (time) {
var parts = time.split(":");
var parts = time.split(":").reverse();
var seconds = 0;
switch (parts.length) {
case 3: