0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-31 06:32:37 +00:00

Make compression raw (no wrapper). Otherwise small files are actually larger after compression.

This commit is contained in:
Trevor Buckner
2020-01-10 08:59:39 -05:00
parent b289cb1003
commit 1ff3f96f6c
2 changed files with 2 additions and 2 deletions

View File

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