diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md old mode 100644 new mode 100755 diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml old mode 100644 new mode 100755 diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md old mode 100644 new mode 100755 diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/public/css/spectre-exp.css b/public/css/spectre-exp.css old mode 100644 new mode 100755 diff --git a/public/css/spectre-icons.css b/public/css/spectre-icons.css old mode 100644 new mode 100755 diff --git a/public/css/spectre.css b/public/css/spectre.css old mode 100644 new mode 100755 diff --git a/scripts/update.sh b/scripts/update.sh old mode 100644 new mode 100755 diff --git a/src/controllers/APIController.ts b/src/controllers/APIController.ts index ec51162a..c94cfe89 100755 --- a/src/controllers/APIController.ts +++ b/src/controllers/APIController.ts @@ -272,8 +272,8 @@ export class APIController { @Get('stats') private async getStats(req: Request, res: Response) { const memory = process.memoryUsage(); - const views: number = (await this.orm.repos.image.find()).map((a) => a.views).reduce((a, b) => Number(a) + Number(b)); - const clicks: number = (await this.orm.repos.shorten.find()).map((a) => a.clicks).reduce((a, b) => Number(a) + Number(b)); + const views: number = (await this.orm.repos.image.find()).map((a) => a.views).reduce((a, b) => Number(a) + Number(b), 0); + const clicks: number = (await this.orm.repos.shorten.find()).map((a) => a.clicks).reduce((a, b) => Number(a) + Number(b), 0); return res.status(200).json({ memory, uploadedStatistics: { diff --git a/src/index.ts b/src/index.ts index df63e740..7826f3ba 100755 --- a/src/index.ts +++ b/src/index.ts @@ -26,7 +26,7 @@ if (!findFile('config.json', process.cwd())) { const config = JSON.parse(readFileSync(findFile('config.json', process.cwd()), 'utf8')) -if (!config.upload?.route) { +if (!config.uploader?.route) { Logger.get('Zipline.Config').error(`Missing needed property on configuration: upload.route`) process.exit(1); } @@ -46,12 +46,7 @@ export interface ORMHandler { const pk = JSON.parse(readFileSync(findFile('package.json', process.cwd()), 'utf8')); (async () => { - const gitPackage = JSON.parse(await GitHub.getFile('package.json')); - const comparedVersion = compare(gitPackage.version, pk.version); - if (comparedVersion == 1) { - Logger.get(`Zipline`).info(`Zipline is ${chalk.bold.redBright('outdated')}, you should run ${chalk.bold.whiteBright('./scripts/update.sh')} to get the best features.`); - process.exit(0); - } + if (compare(JSON.parse(await GitHub.getFile('package.json')).version, pk.version) == 1) Logger.get(`Zipline`).info(`Zipline is ${chalk.bold.redBright('outdated')}, you should run ${chalk.bold.whiteBright('./scripts/update.sh')} to get the best features.`); Logger.get('Zipline').info(`Starting Zipline ${pk.version}`); const connection = await createConnection(config.orm as ConnectionOptions); const orm: ORMHandler = { diff --git a/src/structures/GitHub.ts b/src/structures/GitHub.ts old mode 100644 new mode 100755 index 32e576cf..fa37fe72 --- a/src/structures/GitHub.ts +++ b/src/structures/GitHub.ts @@ -2,7 +2,7 @@ import fetch from 'node-fetch'; export class GitHub { public static async getFile(filePath: string) { - const res = await fetch('https://raw.githubusercontent.com/zipline-project/zipline/master/' + filePath); + const res = await fetch('https://raw.githubusercontent.com/ZiplineProject/Zipline/master/' + filePath); return res.text(); } } \ No newline at end of file