removed uuid dependency from api package

This commit is contained in:
Jan Prochazka
2024-05-20 19:15:03 +02:00
parent 134d8d1b1a
commit 153f40f13e
18 changed files with 20 additions and 38 deletions

View File

@@ -1,11 +1,10 @@
const path = require('path');
const uuidv1 = require('uuid/v1');
const { uploadsdir } = require('../utility/directories');
const { downloadFile } = require('../utility/downloader');
async function download(url) {
if (url && url.match(/(^http:\/\/)|(^https:\/\/)/)) {
const tmpFile = path.join(uploadsdir(), uuidv1());
const tmpFile = path.join(uploadsdir(), crypto.randomUUID());
await downloadFile(url, tmpFile);
return tmpFile;
}