diff options
| author | Zephyrrus <[email protected]> | 2020-07-08 04:00:12 +0300 |
|---|---|---|
| committer | Zephyrrus <[email protected]> | 2020-07-08 04:00:12 +0300 |
| commit | ad852de51a0d2dd5d29c08838d5a430c58849e74 (patch) | |
| tree | a4ab9a720f66271c9eba10916061a9b06c43656e /src/api/utils/Util.js | |
| parent | refactor: refactor grid to use vuex for every action (diff) | |
| download | host.fuwn.me-ad852de51a0d2dd5d29c08838d5a430c58849e74.tar.xz host.fuwn.me-ad852de51a0d2dd5d29c08838d5a430c58849e74.zip | |
chore: linter the entire project using the new rules
Diffstat (limited to 'src/api/utils/Util.js')
| -rw-r--r-- | src/api/utils/Util.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/api/utils/Util.js b/src/api/utils/Util.js index ab59c95..905948a 100644 --- a/src/api/utils/Util.js +++ b/src/api/utils/Util.js @@ -52,7 +52,7 @@ class Util { static getUniqueFilename(name) { const retry = (i = 0) => { - const filename = randomstring.generate({ + const filename = randomstring.generate({ length: parseInt(process.env.GENERATED_FILENAME_LENGTH, 10), capitalization: 'lowercase', }) + path.extname(name).toLowerCase(); @@ -81,7 +81,7 @@ class Util { /* It's funny but if you do i++ the asignment never gets done resulting in an infinite loop */ - if (i < 5) return retry(++i); + if (i < 5) return retry(i + 1); log.error('Couldnt allocate identifier for album'); return null; }; |