Update CleanRemoteNotesProcessorService.ts

This commit is contained in:
syuilo 2025-07-30 17:45:38 +09:00
parent df75343018
commit edb9ba1657
1 changed files with 12 additions and 0 deletions

View File

@ -94,6 +94,18 @@ export class CleanRemoteNotesProcessorService {
return !favorites.some(favorite => favorite.noteId === note.id);
});
const replies = notes.length === 0 ? [] : await this.notesRepository.find({
where: {
replyId: In(notes.map(note => note.id)),
userHost: IsNull(),
},
select: ['replyId'],
});
notes = notes.filter(note => {
return !replies.some(reply => reply.replyId === note.id);
});
if (notes.length === 0) {
job.updateProgress(100);
break;