Don't allow Max Storage Amount below 0

ejs-templating-update
Moe 2022-07-24 07:36:47 -07:00
parent a0d7112025
commit 3787f759b4
1 changed files with 4 additions and 0 deletions

View File

@ -219,15 +219,19 @@ module.exports = function(s,config,lang){
}
//change global size value
s.group[e.ke].usedSpace += currentChange
s.group[e.ke].usedSpace = s.group[e.ke].usedSpace < 0 ? 0 : s.group[e.ke].usedSpace
switch(storageType){
case'timelapeFrames':
s.group[e.ke].usedSpaceTimelapseFrames += currentChange
s.group[e.ke].usedSpaceTimelapseFrames = s.group[e.ke].usedSpaceTimelapseFrames < 0 ? 0 : s.group[e.ke].usedSpaceTimelapseFrames
break;
case'fileBin':
s.group[e.ke].usedSpaceFilebin += currentChange
s.group[e.ke].usedSpaceFilebin = s.group[e.ke].usedSpaceFilebin < 0 ? 0 : s.group[e.ke].usedSpaceFilebin
break;
default:
s.group[e.ke].usedSpaceVideos += currentChange
s.group[e.ke].usedSpaceVideos = s.group[e.ke].usedSpaceVideos < 0 ? 0 : s.group[e.ke].usedSpaceVideos
break;
}
//remove value just used from queue