Fix: Continue importing from file if single emoji import fails
This commit is contained in:
parent
44f62160cb
commit
ed894efa1a
|
@ -8,7 +8,7 @@
|
|||
|
||||
### Server
|
||||
- ファイルがサイズの制限を超えてアップロードされた際にエラーを返さなかった問題を修正
|
||||
|
||||
- Fix: Continue importing from file if single emoji import fails
|
||||
|
||||
## 2024.8.0
|
||||
|
||||
|
|
|
@ -87,23 +87,30 @@ export class ImportCustomEmojisProcessorService {
|
|||
await this.emojisRepository.delete({
|
||||
name: emojiInfo.name,
|
||||
});
|
||||
const driveFile = await this.driveService.addFile({
|
||||
user: null,
|
||||
path: emojiPath,
|
||||
name: record.fileName,
|
||||
force: true,
|
||||
});
|
||||
await this.customEmojiService.add({
|
||||
name: emojiInfo.name,
|
||||
category: emojiInfo.category,
|
||||
host: null,
|
||||
aliases: emojiInfo.aliases,
|
||||
driveFile,
|
||||
license: emojiInfo.license,
|
||||
isSensitive: emojiInfo.isSensitive,
|
||||
localOnly: emojiInfo.localOnly,
|
||||
roleIdsThatCanBeUsedThisEmojiAsReaction: [],
|
||||
});
|
||||
try {
|
||||
const driveFile = await this.driveService.addFile({
|
||||
user: null,
|
||||
path: emojiPath,
|
||||
name: record.fileName,
|
||||
force: true,
|
||||
});
|
||||
await this.customEmojiService.add({
|
||||
name: emojiInfo.name,
|
||||
category: emojiInfo.category,
|
||||
host: null,
|
||||
aliases: emojiInfo.aliases,
|
||||
driveFile,
|
||||
license: emojiInfo.license,
|
||||
isSensitive: emojiInfo.isSensitive,
|
||||
localOnly: emojiInfo.localOnly,
|
||||
roleIdsThatCanBeUsedThisEmojiAsReaction: [],
|
||||
});
|
||||
} catch (e) {
|
||||
if (e instanceof Error || typeof e === 'string') {
|
||||
this.logger.error(`couldn't import ${emojiPath} for ${emojiInfo.name}: ${e}`);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
cleanup();
|
||||
|
|
Loading…
Reference in New Issue