aboutsummaryrefslogtreecommitdiffstats
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.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/internal-server/app/ImageHelper.js b/src/internal-server/app/ImageHelper.js
index e7c981a1d..905ba81ab 100644
--- a/src/internal-server/app/ImageHelper.js
+++ b/src/internal-server/app/ImageHelper.js
@@ -6,7 +6,7 @@ const path = require('path');
6const fs = require('fs-extra'); 6const fs = require('fs-extra');
7const { API_VERSION } = require('../../environment-remote'); 7const { API_VERSION } = require('../../environment-remote');
8 8
9const moveIcon = async (icon) => { 9const moveIcon = async icon => {
10 const iconsPath = path.join(Env.get('USER_PATH'), 'icons'); 10 const iconsPath = path.join(Env.get('USER_PATH'), 'icons');
11 await fs.ensureDir(iconsPath); 11 await fs.ensureDir(iconsPath);
12 12
@@ -24,6 +24,11 @@ const moveIcon = async (icon) => {
24 return !icon.moved() ? '-1' : iconId; 24 return !icon.moved() ? '-1' : iconId;
25}; 25};
26 26
27const deduceIconUrl = (iconId) => iconId ? `http://${Env.get('HOST')}:${Env.get('PORT')}/${API_VERSION}/icon/${iconId}` : null 27const deduceIconUrl = iconId =>
28 iconId
29 ? `http://${Env.get('HOST')}:${Env.get(
30 'PORT',
31 )}/${API_VERSION}/icon/${iconId}`
32 : null;
28 33
29module.exports = { moveIcon, deduceIconUrl }; 34module.exports = { moveIcon, deduceIconUrl };