Reinstate File.PrioritizeRegion() for backward compatibility
This commit is contained in:
parent
77d6e9e5cb
commit
7ac5dfd828
4
file.go
4
file.go
|
@ -79,6 +79,10 @@ func (f *File) Download() {
|
||||||
f.t.DownloadPieces(f.t.torrent.byteRegionPieces(f.offset, f.length))
|
f.t.DownloadPieces(f.t.torrent.byteRegionPieces(f.offset, f.length))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (f *File) PrioritizeRegion(off, len int64) {
|
||||||
|
f.t.DownloadPieces(f.t.torrent.byteRegionPieces(f.offset+off, len))
|
||||||
|
}
|
||||||
|
|
||||||
func byteRegionExclusivePieces(off, size, pieceSize int64) (begin, end int) {
|
func byteRegionExclusivePieces(off, size, pieceSize int64) (begin, end int) {
|
||||||
begin = int((off + pieceSize - 1) / pieceSize)
|
begin = int((off + pieceSize - 1) / pieceSize)
|
||||||
end = int((off + size) / pieceSize)
|
end = int((off + size) / pieceSize)
|
||||||
|
|
Loading…
Reference in New Issue