fix: ignore error if poster path already exists

This commit is contained in:
Feross Aboukhadijeh
2016-03-19 17:06:56 -07:00
parent f613486bb8
commit 6b6d1ee1c7

View File

@@ -462,8 +462,7 @@ function generateTorrentPoster (torrent, torrentSummary) {
torrentPoster(torrent, function (err, buf) {
if (err) return onWarning(err)
// save it for next time
fs.mkdir(config.CONFIG_POSTER_PATH, function (err) {
if (err) return onWarning(err)
fs.mkdir(config.CONFIG_POSTER_PATH, function (_) {
var posterFilePath = path.join(config.CONFIG_POSTER_PATH, torrent.infoHash + '.jpg')
fs.writeFile(posterFilePath, buf, function (err) {
if (err) return onWarning(err)