diff options
Diffstat (limited to 'src/internal-server/app/ImageHelper.js')
-rw-r--r-- | src/internal-server/app/ImageHelper.js | 7 |
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 | ||
5 | const path = require('path'); | 5 | const path = require('path'); |
6 | const fs = require('fs-extra'); | 6 | const fs = require('fs-extra'); |
7 | const { API_VERSION } = require('../../environment-remote'); | ||
7 | 8 | ||
8 | module.exports = async (icon) => { | 9 | const 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 | |||
27 | const deduceIconUrl = (iconId) => iconId ? `http://${Env.get('HOST')}:${Env.get('PORT')}/${API_VERSION}/icon/${iconId}` : null | ||
28 | |||
29 | module.exports = { moveIcon, deduceIconUrl }; | ||