feat: add cloud transfer and cache optimizations

This commit is contained in:
ShukeBta
2026-06-09 19:03:28 +08:00
parent a55fc502ca
commit 7d7f3cc758
27 changed files with 1972 additions and 117 deletions
+5 -6
View File
@@ -108,16 +108,15 @@ func (o *OrganizerService) defaultDestRoot(ctx context.Context, override string)
// OrganizeDirectory organizes every video file found under opts.SourcePath into
// the destination root, applying dedup + 洗版 (resolution replacement).
func (o *OrganizerService) OrganizeDirectory(ctx context.Context, opts OrganizeOptions) (*OrganizeResult, error) {
source := strings.TrimSpace(o.defaultSourceRoot(ctx, opts.SourcePath))
if source == "" {
requestedSource := strings.TrimSpace(o.defaultSourceRoot(ctx, opts.SourcePath))
if requestedSource == "" {
return nil, errors.New("source path required")
}
source = filepath.Clean(source)
info, statErr := os.Stat(source)
source, info, statErr := resolveAccessibleMappedPath(requestedSource)
if statErr != nil {
return nil, fmt.Errorf("source directory not accessible: %s", source)
return nil, fmt.Errorf("source directory not accessible: %s", filepath.Clean(requestedSource))
}
dest := filepath.Clean(o.defaultDestRoot(ctx, opts.DestPath))
dest := resolveMappedDestinationPath(o.defaultDestRoot(ctx, opts.DestPath))
if dest == "" || dest == "." {
return nil, errors.New("destination path required")
}