From e4d8e2a5806bcc2cf531aadc2674ba2945418d28 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 17 Oct 2023 14:38:08 +0000 Subject: [PATCH] Create fake download method --- src/models/file.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/models/file.js b/src/models/file.js index 86600df..f2ee313 100644 --- a/src/models/file.js +++ b/src/models/file.js @@ -40,6 +40,24 @@ class File { + /** + * Download a file from a url + * @returns {Promise} filepath + */ + async fakeDownload() { + const url = URL.parse(this.url); + this.filename = slugify(url.hostname, { lower: true }); + const filepath = path.join(dest, `bodacc-datadila.opendatasoft.com-1697536785170.csv`); + const generatedpath = path.join(dest, `bodacc-datadila.opendatasoft.com-generated-1697536785170-2.csv`); + this.filepath = filepath; + this.generatedpath = generatedpath; + return new Promise((resolve, reject) => { + resolve(filepath); + }); + } + + + /** * Download a file from a url * @returns {Promise} filepath