mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-03-03 11:27:50 +01:00
fixes readableStream fuckery, needs testing
This commit is contained in:
parent
baac38f888
commit
b91bc21d60
@ -5250,6 +5250,7 @@ app.post('/asset_download', jsonParser, async (request, response) => {
|
||||
const inputCategory = request.body.category;
|
||||
const inputFilename = sanitize(request.body.filename);
|
||||
const validCategories = ["bgm", "ambient"];
|
||||
const fetch = require('node-fetch').default;
|
||||
|
||||
// Check category
|
||||
let category = null;
|
||||
@ -5285,7 +5286,7 @@ app.post('/asset_download', jsonParser, async (request, response) => {
|
||||
});
|
||||
}
|
||||
const fileStream = fs.createWriteStream(destination, { flags: 'wx' });
|
||||
await finished(Readable.fromWeb(res.body).pipe(fileStream));
|
||||
await finished(res.body.pipe(fileStream));
|
||||
|
||||
// Move into asset place
|
||||
console.debug("Download finished, moving file from", temp_path, "to", file_path);
|
||||
|
Loading…
x
Reference in New Issue
Block a user