fix: create parent dirs for downloads with subdirectory paths
Some archive.org file names include directory prefixes (e.g. "ZERO-G - Deepest India/vocal.iso"). MkdirAll only created the output root, not intermediate directories. Added filepath.Dir(MkdirAll) in both downloadFile (CLI) and handleAPIDownload (web).
This commit is contained in:
@@ -330,6 +330,8 @@ func cmdDownload(args []string) {
|
||||
}
|
||||
|
||||
func downloadFile(job downloadJob) (int64, error) {
|
||||
os.MkdirAll(filepath.Dir(job.OutPath), 0755)
|
||||
|
||||
// Check if file already exists and has the expected size
|
||||
if fi, err := os.Stat(job.OutPath); err == nil {
|
||||
if job.Size > 0 && fi.Size() == job.Size {
|
||||
|
||||
Reference in New Issue
Block a user