refactor: change to const

v1.18.x
Barış Soner Uşaklı 5 years ago
parent 058581333e
commit 5505628c8d

@ -1,11 +1,11 @@
'use strict'; 'use strict';
var winston = require('winston'); const winston = require('winston');
var file = require('../file'); const db = require('../database');
var image = require('../image'); const file = require('../file');
var meta = require('../meta'); const image = require('../image');
var db = require('../database'); const meta = require('../meta');
module.exports = function (User) { module.exports = function (User) {
User.updateCoverPosition = async function (uid, position) { User.updateCoverPosition = async function (uid, position) {
@ -124,7 +124,7 @@ module.exports = function (User) {
}; };
async function convertToPNG(path, extension) { async function convertToPNG(path, extension) {
var convertToPNG = meta.config['profile:convertProfileImageToPNG'] === 1; const convertToPNG = meta.config['profile:convertProfileImageToPNG'] === 1;
if (!convertToPNG) { if (!convertToPNG) {
return path; return path;
} }
@ -134,8 +134,8 @@ module.exports = function (User) {
} }
function generateProfileImageFilename(uid, type, extension) { function generateProfileImageFilename(uid, type, extension) {
var keepAllVersions = meta.config['profile:keepAllUserImages'] === 1; const keepAllVersions = meta.config['profile:keepAllUserImages'] === 1;
var convertToPNG = meta.config['profile:convertProfileImageToPNG'] === 1; const convertToPNG = meta.config['profile:convertProfileImageToPNG'] === 1;
return uid + '-' + type + (keepAllVersions ? '-' + Date.now() : '') + (convertToPNG ? '.png' : extension); return uid + '-' + type + (keepAllVersions ? '-' + Date.now() : '') + (convertToPNG ? '.png' : extension);
} }

Loading…
Cancel
Save