fix: ignore error if poster path already exists
This commit is contained in:
@@ -462,8 +462,7 @@ function generateTorrentPoster (torrent, torrentSummary) {
|
|||||||
torrentPoster(torrent, function (err, buf) {
|
torrentPoster(torrent, function (err, buf) {
|
||||||
if (err) return onWarning(err)
|
if (err) return onWarning(err)
|
||||||
// save it for next time
|
// save it for next time
|
||||||
fs.mkdir(config.CONFIG_POSTER_PATH, function (err) {
|
fs.mkdir(config.CONFIG_POSTER_PATH, function (_) {
|
||||||
if (err) return onWarning(err)
|
|
||||||
var posterFilePath = path.join(config.CONFIG_POSTER_PATH, torrent.infoHash + '.jpg')
|
var posterFilePath = path.join(config.CONFIG_POSTER_PATH, torrent.infoHash + '.jpg')
|
||||||
fs.writeFile(posterFilePath, buf, function (err) {
|
fs.writeFile(posterFilePath, buf, function (err) {
|
||||||
if (err) return onWarning(err)
|
if (err) return onWarning(err)
|
||||||
|
|||||||
Reference in New Issue
Block a user