Write poster images into "$CONFIG_PATH/posters" (fix #155)

This commit is contained in:
Feross Aboukhadijeh
2016-03-19 16:19:15 -07:00
parent 0c9e2cc27e
commit 684fa7dee7
4 changed files with 11 additions and 8 deletions

View File

@@ -1,7 +1,6 @@
console.time('init')
var cfg = require('application-config')('WebTorrent')
var cfgDirectory = require('application-config-path')('WebTorrent')
var createTorrent = require('create-torrent')
var dragDrop = require('drag-drop')
var electron = require('electron')
@@ -462,7 +461,7 @@ function generateTorrentPoster (torrent, torrentSummary) {
torrentPoster(torrent, function (err, buf) {
if (err) return onWarning(err)
// save it for next time
var posterFilePath = path.join(cfgDirectory, torrent.infoHash + '.jpg')
var posterFilePath = path.join(config.CONFIG_POSTER_PATH, torrent.infoHash + '.jpg')
fs.writeFile(posterFilePath, buf, function (err) {
if (err) return onWarning(err)
// show the poster