diff --git a/package.json b/package.json index 182da9f4c..9bbaf7918 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "teledrive", - "version": "1.8.0", + "version": "1.8.3", "repository": "git@github.com:mgilangjanuar/teledrive.git", "author": "M Gilang Januar ", "license": "MIT", diff --git a/server/package.json b/server/package.json index b8518f09a..b947f5e01 100644 --- a/server/package.json +++ b/server/package.json @@ -1,6 +1,6 @@ { "name": "server", - "version": "1.8.0", + "version": "1.8.3", "main": "dist/index.js", "license": "MIT", "private": true, diff --git a/server/src/api/v1/Files.ts b/server/src/api/v1/Files.ts index 9fbc4833a..8aac50d43 100644 --- a/server/src/api/v1/Files.ts +++ b/server/src/api/v1/Files.ts @@ -18,7 +18,7 @@ export class Files { @Endpoint.GET('/', { middlewares: [AuthMaybe] }) public async find(req: Request, res: Response): Promise { - const { sort, offset, limit, shared, t: _t, ...filters } = req.query + const { sort, offset, limit, shared, exclude_parts: excludeParts, t: _t, ...filters } = req.query const parent = filters?.parent_id ? await Model.findOne(filters.parent_id as string) : null if (filters?.parent_id && !parent) { throw { status: 404, body: { error: 'Parent not found' } } @@ -39,6 +39,9 @@ export class Files { .where(where, { user: shared ? req.user?.username : req.user?.id }) .andWhere(buildWhereQuery(filters, 'files.') || 'true') + if (excludeParts === 'true' || excludeParts === '1') { + query = query.andWhere('(files.name ~ \'.part0*1$\' or files.name !~ \'.part[0-9]+$\')') + } if (shared && where !== 'true') { query = query.leftJoin('files.parent', 'parent') } diff --git a/server/src/api/v1/Users.ts b/server/src/api/v1/Users.ts index b00c3f6d2..2aeb9f2cb 100644 --- a/server/src/api/v1/Users.ts +++ b/server/src/api/v1/Users.ts @@ -65,7 +65,7 @@ export class Users { @Endpoint.PATCH('/me/settings', { middlewares: [Auth] }) public async settings(req: Request, res: Response): Promise { const { settings } = req.body - if (settings.theme === 'dark' && (!req.user.plan || req.user.plan === 'free')) { + if (settings.theme === 'dark' && (!req.user.plan || req.user.plan === 'free') && moment().format('l') !== '2/2/2022') { throw { status: 402, body: { error: 'You need to upgrade your plan to use dark theme' } } } req.user.settings = { diff --git a/web/package.json b/web/package.json index d572dcf0e..2a8644d7b 100644 --- a/web/package.json +++ b/web/package.json @@ -1,6 +1,6 @@ { "name": "web", - "version": "1.8.0", + "version": "1.8.3", "private": true, "dependencies": { "@ideasio/add-to-homescreen-react": "^1.0.10", diff --git a/web/public/index.html b/web/public/index.html index 4ba5b9fa5..1b0e35f9d 100644 --- a/web/public/index.html +++ b/web/public/index.html @@ -31,7 +31,7 @@ Learn how to configure a non-root public URL by running `npm run build`. --> TeleDrive - The Free Unlimited Cloud Storage - +