delete old emoji file when replaced - fixes #608
it's the same code that 5f7fc54ee9
added
to `delete` and `deleteBulk`, with the extra check that we're not
deleting the same file we're setting
This commit is contained in:
parent
5496aa27db
commit
1e86cba7dc
@ -142,6 +142,13 @@ export class CustomEmojiService implements OnApplicationShutdown {
|
|||||||
|
|
||||||
this.localEmojisCache.refresh();
|
this.localEmojisCache.refresh();
|
||||||
|
|
||||||
|
if (data.driveFile != null) {
|
||||||
|
const file = await this.driveFilesRepository.findOneBy({ url: emoji.originalUrl, userHost: emoji.host ? emoji.host : IsNull() });
|
||||||
|
if (file && file.id != data.driveFile.id) {
|
||||||
|
await this.driveService.deleteFile(file, false, moderator ? moderator : undefined);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const packed = await this.emojiEntityService.packDetailed(emoji.id);
|
const packed = await this.emojiEntityService.packDetailed(emoji.id);
|
||||||
|
|
||||||
if (emoji.name === data.name) {
|
if (emoji.name === data.name) {
|
||||||
|
Loading…
Reference in New Issue
Block a user