アニメーション画像を無効にする際、サーバーサイドではなくクライアントサイドでURLを変更するように

This commit is contained in:
syuilo 2019-02-05 03:51:54 +09:00
parent f014b7ae0e
commit 861302f0fd
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
14 changed files with 40 additions and 56 deletions

View file

@ -1,11 +1,10 @@
import * as mongo from 'mongodb';
import * as deepcopy from 'deepcopy';
import { pack as packFolder } from './drive-folder';
import { pack as packUser, IUser } from './user';
import { pack as packUser } from './user';
import monkDb, { nativeDbConn, dbLogger } from '../db/mongodb';
import isObjectId from '../misc/is-objectid';
import getDriveFileUrl, { getOriginalUrl } from '../misc/get-drive-file-url';
import wrapUrl from '../misc/wrap-url';
const DriveFile = monkDb.get<IDriveFile>('driveFiles.files');
DriveFile.createIndex('md5');
@ -134,7 +133,6 @@ export const packMany = (
detail?: boolean
self?: boolean,
withUser?: boolean,
me?: string | mongo.ObjectID | IUser,
}
) => {
return Promise.all(files.map(f => pack(f, options)));
@ -149,7 +147,6 @@ export const pack = (
detail?: boolean,
self?: boolean,
withUser?: boolean,
me?: string | mongo.ObjectID | IUser,
}
) => new Promise<any>(async (resolve, reject) => {
const opts = Object.assign({
@ -192,11 +189,6 @@ export const pack = (
_target.url = getDriveFileUrl(_file);
_target.thumbnailUrl = getDriveFileUrl(_file, true);
if (_target.thumbnailUrl != null) {
_target.thumbnailUrl = wrapUrl(_target.thumbnailUrl, options.me);
}
_target.isRemote = _file.metadata.isRemote;
if (_target.properties == null) _target.properties = {};