mirror of
https://github.com/kokonect-link/cherrypick
synced 2024-11-01 23:55:58 +09:00
ドライブのファイルにユーザー情報を非正規化
This commit is contained in:
parent
d000b9e7cd
commit
f62603fd9d
@ -25,6 +25,7 @@ export const getDriveFileBucket = async (): Promise<mongo.GridFSBucket> => {
|
|||||||
export type IMetadata = {
|
export type IMetadata = {
|
||||||
properties: any;
|
properties: any;
|
||||||
userId: mongo.ObjectID;
|
userId: mongo.ObjectID;
|
||||||
|
_user: any;
|
||||||
folderId: mongo.ObjectID;
|
folderId: mongo.ObjectID;
|
||||||
comment: string;
|
comment: string;
|
||||||
uri: string;
|
uri: string;
|
||||||
|
@ -15,7 +15,7 @@ import DriveFolder from '../../models/drive-folder';
|
|||||||
import { pack } from '../../models/drive-file';
|
import { pack } from '../../models/drive-file';
|
||||||
import event, { publishDriveStream } from '../../publishers/stream';
|
import event, { publishDriveStream } from '../../publishers/stream';
|
||||||
import getAcct from '../../acct/render';
|
import getAcct from '../../acct/render';
|
||||||
import { IUser, isLocalUser } from '../../models/user';
|
import { IUser, isLocalUser, isRemoteUser } from '../../models/user';
|
||||||
import DriveFileThumbnail, { getDriveFileThumbnailBucket, DriveFileThumbnailChunk } from '../../models/drive-file-thumbnail';
|
import DriveFileThumbnail, { getDriveFileThumbnailBucket, DriveFileThumbnailChunk } from '../../models/drive-file-thumbnail';
|
||||||
import genThumbnail from '../../drive/gen-thumbnail';
|
import genThumbnail from '../../drive/gen-thumbnail';
|
||||||
|
|
||||||
@ -284,6 +284,9 @@ const addFile = async (
|
|||||||
|
|
||||||
const metadata = {
|
const metadata = {
|
||||||
userId: user._id,
|
userId: user._id,
|
||||||
|
_user: {
|
||||||
|
host: user.host
|
||||||
|
},
|
||||||
folderId: folder !== null ? folder._id : null,
|
folderId: folder !== null ? folder._id : null,
|
||||||
comment: comment,
|
comment: comment,
|
||||||
properties: properties
|
properties: properties
|
||||||
|
Loading…
Reference in New Issue
Block a user