mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 21:46:11 +05:00
disable close torrent on reading it
This commit is contained in:
@@ -139,9 +139,6 @@ func SetTorrent(hashHex, title, poster, data string) *Torrent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func RemTorrent(hashHex string) {
|
func RemTorrent(hashHex string) {
|
||||||
if sets.ReadOnly {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
hash := metainfo.NewHashFromHex(hashHex)
|
hash := metainfo.NewHashFromHex(hashHex)
|
||||||
if sets.BTsets.UseDisk && hashHex != "" && hashHex != "/" {
|
if sets.BTsets.UseDisk && hashHex != "" && hashHex != "/" {
|
||||||
name := filepath.Join(sets.BTsets.TorrentsSavePath, hashHex)
|
name := filepath.Join(sets.BTsets.TorrentsSavePath, hashHex)
|
||||||
|
|||||||
@@ -266,6 +266,9 @@ func (t *Torrent) drop() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (t *Torrent) Close() {
|
func (t *Torrent) Close() {
|
||||||
|
if t.cache != nil && t.cache.Readers() > 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
t.Stat = state.TorrentClosed
|
t.Stat = state.TorrentClosed
|
||||||
|
|
||||||
t.bt.mu.Lock()
|
t.bt.mu.Lock()
|
||||||
|
|||||||
Reference in New Issue
Block a user