mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 21:46:11 +05:00
add not delete pieces in start/end of file
This commit is contained in:
@@ -2,10 +2,13 @@ package torrstor
|
||||
|
||||
import (
|
||||
"sort"
|
||||
|
||||
"github.com/anacrolix/torrent"
|
||||
)
|
||||
|
||||
type Range struct {
|
||||
Start, End int
|
||||
File *torrent.File
|
||||
}
|
||||
|
||||
func inRanges(ranges []Range, ind int) bool {
|
||||
|
||||
@@ -144,7 +144,7 @@ func (c *Cache) updatePriority() {
|
||||
|
||||
func (r *Reader) getPiecesRange() Range {
|
||||
startOff, endOff := r.getOffsetRange()
|
||||
return Range{r.getPieceNum(startOff), r.getPieceNum(endOff)}
|
||||
return Range{r.getPieceNum(startOff), r.getPieceNum(endOff), r.file}
|
||||
}
|
||||
|
||||
func (r *Reader) getReaderPiece() int {
|
||||
|
||||
Reference in New Issue
Block a user