fix #365 parsing media limit
This commit is contained in:
parent
d42fc2eabf
commit
4f7e4ad65e
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue