Skip to content

Commit

Permalink
wrong thumbnail path in delete
Browse files Browse the repository at this point in the history
  • Loading branch information
ravibail committed Aug 24, 2016
1 parent 6f65f7a commit d75423b
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions app/controllers/assets.js
Expand Up @@ -170,12 +170,16 @@ exports.deleteFile = function (req, res) {
function(next) {
var thumbnailPath = path.join(config.thumbnailDir, file);
if (file.match(config.videoRegex))
thumbnailPath += '_1.png';
fs.unlink(thumbnailPath, function (err) {
if (err)
util.log('unable to find/delete thumbnail: ' + err)
next();
})
thumbnailPath += '.png';
if(file.match(config.videoRegex) || file.match(config.imageRegex)){
fs.unlink(thumbnailPath, function (err) {
if (err)
util.log('unable to find/delete thumbnail: ' + err)
next();
})
} else {
next()
}
}
], function(err) {
if (err)
Expand Down

0 comments on commit d75423b

Please sign in to comment.