优化跨盘秒传

This commit is contained in:
King committed 2026-07-30 15:18:10 +08:00
1 parent b814ac6d43
commit 4cffa98fb5
163 files changed
+365 -98

No files matched your search

+21
View File
@@ -41,6 +41,27 @@ func (h *Handler) crossTransferScan(w http.ResponseWriter, r *http.Request) {
writeOK(w, result)
}
func (h *Handler) crossTransferScanStream(w http.ResponseWriter, r *http.Request) {
if !ensureServiceReady(w, h.crossTransfer != nil) {
return
}
var req crossTransferScanReq
if err := decodeJSON(r, &req); err != nil {
writeErr(w, err)
return
}
h.streamCrossTransferNDJSON(w, r, func(emit func(crosstransfer.StreamEvent) error) error {
return h.crossTransfer.ScanSourceStream(
r.Context(),
req.SourceAccountID,
req.SourceParentID,
req.Method,
req.SourceDisplayPath,
emit,
)
})
}
type crossTransferProbeFile struct {
SourceFileID string `json:"source_file_id"`
RelPath string `json:"rel_path"`
+2 -1
View File
@@ -25,9 +25,9 @@ import (
"litepan/internal/crosstransfer"
"litepan/internal/domain"
"litepan/internal/embyproxy"
"litepan/internal/fnosproxy"
"litepan/internal/favorites"
"litepan/internal/file"
"litepan/internal/fnosproxy"
"litepan/internal/fusemount"
"litepan/internal/logx"
"litepan/internal/mediaorganize"
@@ -171,6 +171,7 @@ func NewRouter(d Deps) http.Handler {
r.Route("/cross-transfer", func(r chi.Router) {
r.Get("/routes", h.crossTransferRoutes)
r.Post("/scan", h.crossTransferScan)
r.Post("/scan/stream", h.crossTransferScanStream)
r.Post("/probe", h.crossTransferProbe)
r.Post("/execute", h.crossTransferExecute)
r.Get("/relay/tasks", h.crossTransferRelayTasks)
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loaded 100 of 163 files, more files were not shown because too many files have changed in this diff. Show more