Merge tag '2023.9.0' into merge-upstream

This commit is contained in:
riku6460
2023-09-25 12:43:07 +09:00
1235 changed files with 19016 additions and 13835 deletions

View File

@@ -5,11 +5,12 @@
import { Inject, Injectable } from '@nestjs/common';
import { DI } from '@/di-symbols.js';
import type { FlashLikesRepository, FlashsRepository } from '@/models/index.js';
import type { FlashsRepository, FlashLikesRepository } from '@/models/_.js';
import { awaitAll } from '@/misc/prelude/await-all.js';
import type { Packed } from '@/misc/json-schema.js';
import type { MiUser } from '@/models/entities/User.js';
import type { MiFlash } from '@/models/entities/Flash.js';
import type { } from '@/models/Blocking.js';
import type { MiUser } from '@/models/User.js';
import type { MiFlash } from '@/models/Flash.js';
import { bindThis } from '@/decorators.js';
import { UserEntityService } from './UserEntityService.js';
@@ -29,7 +30,7 @@ export class FlashEntityService {
@bindThis
public async pack(
src: MiFlash['id'] | MiFlash,
me: { id: MiUser['id'] } | null | undefined,
me?: { id: MiUser['id'] } | null | undefined,
): Promise<Packed<'Flash'>> {
const meId = me ? me.id : null;
const flash = typeof src === 'object' ? src : await this.flashsRepository.findOneByOrFail({ id: src });
@@ -50,8 +51,8 @@ export class FlashEntityService {
@bindThis
public async packMany(
flashs: (MiFlash['id'] | MiFlash)[],
me: { id: MiUser['id'] } | null | undefined,
flashs: MiFlash[],
me?: { id: MiUser['id'] } | null | undefined,
) : Promise<Packed<'Flash'>[]> {
return (await Promise.allSettled(flashs.map(x => this.pack(x, me))))
.filter(result => result.status === 'fulfilled')