diff --git a/server/torr/apihelper.go b/server/torr/apihelper.go index 247adc7..1384ec0 100644 --- a/server/torr/apihelper.go +++ b/server/torr/apihelper.go @@ -139,9 +139,6 @@ func SetTorrent(hashHex, title, poster, data string) *Torrent { } func RemTorrent(hashHex string) { - if sets.ReadOnly { - return - } hash := metainfo.NewHashFromHex(hashHex) if sets.BTsets.UseDisk && hashHex != "" && hashHex != "/" { name := filepath.Join(sets.BTsets.TorrentsSavePath, hashHex) diff --git a/server/torr/torrent.go b/server/torr/torrent.go index 694602e..a67a87d 100644 --- a/server/torr/torrent.go +++ b/server/torr/torrent.go @@ -266,6 +266,9 @@ func (t *Torrent) drop() { } func (t *Torrent) Close() { + if t.cache != nil && t.cache.Readers() > 0 { + return + } t.Stat = state.TorrentClosed t.bt.mu.Lock()