0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-04 16:52:38 +00:00

Admin controls for compressing old brews

This commit is contained in:
Trevor Buckner
2020-01-23 10:50:35 -05:00
parent 4128670a9f
commit a06b29c6f5
6 changed files with 125 additions and 5 deletions

View File

@@ -53,7 +53,7 @@ HomebrewSchema.statics.get = function(query){
return new Promise((resolve, reject)=>{
Homebrew.find(query, (err, brews)=>{
if(err || !brews.length) return reject('Can not find brew');
if(!_.isUndefined(brews[0].textBin)) { // Uncompress zipped text field
if(!_.isNil(brews[0].textBin)) { // Uncompress zipped text field
unzipped = zlib.inflateRawSync(brews[0].textBin);
brews[0].text = unzipped.toString();
}