summaryrefslogtreecommitdiffstats
path: root/src/internal-server/app/ImageHelper.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/internal-server/app/ImageHelper.js')
-rw-r--r--src/internal-server/app/ImageHelper.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/internal-server/app/ImageHelper.js b/src/internal-server/app/ImageHelper.js
index b399d08c4..e7c981a1d 100644
--- a/src/internal-server/app/ImageHelper.js
+++ b/src/internal-server/app/ImageHelper.js
@@ -4,8 +4,9 @@ const { v4: uuid } = require('uuid');
4 4
5const path = require('path'); 5const path = require('path');
6const fs = require('fs-extra'); 6const fs = require('fs-extra');
7const { API_VERSION } = require('../../environment-remote');
7 8
8module.exports = async (icon) => { 9const moveIcon = async (icon) => {
9 const iconsPath = path.join(Env.get('USER_PATH'), 'icons'); 10 const iconsPath = path.join(Env.get('USER_PATH'), 'icons');
10 await fs.ensureDir(iconsPath); 11 await fs.ensureDir(iconsPath);
11 12
@@ -22,3 +23,7 @@ module.exports = async (icon) => {
22 }); 23 });
23 return !icon.moved() ? '-1' : iconId; 24 return !icon.moved() ? '-1' : iconId;
24}; 25};
26
27const deduceIconUrl = (iconId) => iconId ? `http://${Env.get('HOST')}:${Env.get('PORT')}/${API_VERSION}/icon/${iconId}` : null
28
29module.exports = { moveIcon, deduceIconUrl };