fix reader pause if count 1

This commit is contained in:
YouROK
2021-05-27 08:54:47 +03:00
parent 2af1752a00
commit 7634722049

View File

@@ -135,7 +135,7 @@ func (r *Reader) getPieceNum(offset int64) int {
func (r *Reader) getOffsetRange() (int64, int64) {
if time.Now().Unix() > r.lastAccess+60 {
if time.Now().Unix() > r.lastAccess+60 && len(r.cache.readers) > 1 {
return r.file.Offset(), r.file.Offset()
}