enhance: カスタム絵文字にライセンス情報を付与できるように

Resolve #10091
This commit is contained in:
syuilo
2023-03-16 15:08:48 +09:00
parent a9bc22e4e6
commit 8ae9d2eaa8
12 changed files with 36 additions and 0 deletions

View File

@ -44,6 +44,7 @@ export class CustomEmojiService {
category: string | null;
aliases: string[];
host: string | null;
license: string | null;
}): Promise<Emoji> {
const emoji = await this.emojisRepository.insert({
id: this.idService.genId(),
@ -55,6 +56,7 @@ export class CustomEmojiService {
originalUrl: data.driveFile.url,
publicUrl: data.driveFile.webpublicUrl ?? data.driveFile.url,
type: data.driveFile.webpublicType ?? data.driveFile.type,
license: data.license,
}).then(x => this.emojisRepository.findOneByOrFail(x.identifiers[0]));
if (data.host == null) {

View File

@ -50,6 +50,7 @@ export class EmojiEntityService {
host: emoji.host,
// || emoji.originalUrl してるのは後方互換性のためpublicUrlはstringなので??はだめ)
url: emoji.publicUrl || emoji.originalUrl,
license: emoji.license,
};
}