mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 21:46:11 +05:00
fix freez preload
This commit is contained in:
@@ -277,9 +277,9 @@ func (t *Torrent) Preload(index int, size int64) {
|
|||||||
readerEnd.Seek(-1024, io.SeekEnd)
|
readerEnd.Seek(-1024, io.SeekEnd)
|
||||||
readerEnd.Read(make([]byte, 1))
|
readerEnd.Read(make([]byte, 1))
|
||||||
defer t.cache.CloseReader(readerEnd)
|
defer t.cache.CloseReader(readerEnd)
|
||||||
|
pl := t.Info().PieceLength
|
||||||
lastStat := ""
|
lastStat := ""
|
||||||
for t.PreloadedBytes < size {
|
for t.PreloadedBytes < size-pl {
|
||||||
t.muTorrent.Lock()
|
t.muTorrent.Lock()
|
||||||
if t.Torrent == nil {
|
if t.Torrent == nil {
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user