mirror of
https://github.com/paricafe/misskey.git
synced 2024-11-24 21:06:43 -06:00
parent
44cafbb9f2
commit
e57ce4fa0f
1 changed files with 7 additions and 7 deletions
|
@ -497,20 +497,20 @@ export class DriveService {
|
||||||
|
|
||||||
if (user && !force) {
|
if (user && !force) {
|
||||||
// Check if there is a file with the same hash
|
// Check if there is a file with the same hash
|
||||||
const much = await this.driveFilesRepository.findOneBy({
|
const matched = await this.driveFilesRepository.findOneBy({
|
||||||
md5: info.md5,
|
md5: info.md5,
|
||||||
userId: user.id,
|
userId: user.id,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (much) {
|
if (matched) {
|
||||||
this.registerLogger.info(`file with same hash is found: ${much.id}`);
|
this.registerLogger.info(`file with same hash is found: ${matched.id}`);
|
||||||
if (sensitive && !much.isSensitive) {
|
if (sensitive && !matched.isSensitive) {
|
||||||
// The file is federated as sensitive for this time, but was federated as non-sensitive before.
|
// The file is federated as sensitive for this time, but was federated as non-sensitive before.
|
||||||
// Therefore, update the file to sensitive.
|
// Therefore, update the file to sensitive.
|
||||||
await this.driveFilesRepository.update({ id: much.id }, { isSensitive: true });
|
await this.driveFilesRepository.update({ id: matched.id }, { isSensitive: true });
|
||||||
much.isSensitive = true;
|
matched.isSensitive = true;
|
||||||
}
|
}
|
||||||
return much;
|
return matched;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue