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