This commit is contained in:
Dakedres 2024-04-11 09:11:50 -06:00
parent 95e4d064a4
commit 0ee7c8d016

8
lib.js
View File

@ -611,15 +611,15 @@ export const downloadImage = async (url, basename, source, view) => {
return url
}
let relativePath = Path.join(view.imageStoreDirectory, basename + extension)
let path = Path.join(view.path, relativePath)
let pathname = Path.join(view.imageStoreDirectory, basename + extension)
let path = Path.join(view.path, pathname)
const download = () => write(path, response.body)
.then(annotate( `Downloaded ${relativePath}`))
.then(annotate( `Downloaded ${pathname}`))
// TODO: See if the image is downloaded before even trying to download it
view.batch.add(FS.access(path).catch(download))
return relativePath
return pathname
} else {
console.error( createNetworkingError(response) )
return url