mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-30 17:32:38 +00:00
Admin script to compress old brews
Also fully delete the text field after compressed version is saved instead of leaving just an empty field.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user