perf: optimize IO read/write usage (#8243)

* perf: optimize IO read/write usage

* .

* Update drivers/139/driver.go

Co-authored-by: MadDogOwner <xiaoran@xrgzs.top>

---------

Co-authored-by: MadDogOwner <xiaoran@xrgzs.top>
This commit is contained in:
j2rong4cn
2025-04-12 16:55:31 +08:00
committed by GitHub
parent 3375c26c41
commit ddffacf07b
29 changed files with 427 additions and 341 deletions

View File

@@ -2,6 +2,7 @@ package model
import (
"io"
"os"
"sort"
"strings"
"time"
@@ -48,7 +49,8 @@ type FileStreamer interface {
RangeRead(http_range.Range) (io.Reader, error)
//for a non-seekable Stream, if Read is called, this function won't work
CacheFullInTempFile() (File, error)
CacheFullInTempFileAndUpdateProgress(up UpdateProgress) (File, error)
SetTmpFile(r *os.File)
GetFile() File
}
type UpdateProgress func(percentage float64)