mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 21:46:11 +05:00
fix bug when torrent preload and close it
This commit is contained in:
@@ -283,6 +283,7 @@ func (t *Torrent) Preload(index int, size int64) {
|
|||||||
readerEnd.Read(make([]byte, 1))
|
readerEnd.Read(make([]byte, 1))
|
||||||
defer t.CloseReader(readerEnd)
|
defer t.CloseReader(readerEnd)
|
||||||
|
|
||||||
|
if t.Info() != nil {
|
||||||
pl := t.Info().PieceLength
|
pl := t.Info().PieceLength
|
||||||
lastStat := ""
|
lastStat := ""
|
||||||
|
|
||||||
@@ -301,6 +302,7 @@ func (t *Torrent) Preload(index int, size int64) {
|
|||||||
}
|
}
|
||||||
time.Sleep(time.Millisecond * 1000)
|
time.Sleep(time.Millisecond * 1000)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
log.TLogln("End preload:", file.Torrent().InfoHash().HexString(), "Peers:[", t.Torrent.Stats().ConnectedSeeders, "]", t.Torrent.Stats().ActivePeers, "/", t.Torrent.Stats().TotalPeers)
|
log.TLogln("End preload:", file.Torrent().InfoHash().HexString(), "Peers:[", t.Torrent.Stats().ConnectedSeeders, "]", t.Torrent.Stats().ActivePeers, "/", t.Torrent.Stats().TotalPeers)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user