config: add create_on_announce option

This option allows the user to specify whether or not to create a new
swarm for torrents that do not previously exist within the tracker's
storage.
This commit is contained in:
Jimmy Zelinskie
2015-03-23 20:02:13 -04:00
parent 0ecd126ae8
commit 80c068c97a
3 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ func (tkr *Tracker) HandleAnnounce(ann *models.Announce, w Writer) (err error) {
torrent, err := tkr.FindTorrent(ann.Infohash)
if err == models.ErrTorrentDNE && !tkr.Config.PrivateEnabled {
if err == models.ErrTorrentDNE && cfg.CreateOnAnnounce {
torrent = &models.Torrent{
Infohash: ann.Infohash,
Seeders: models.NewPeerMap(true, tkr.Config),