Skip to content
This repository was archived by the owner on Dec 26, 2022. It is now read-only.

Commit e5cb86e

Browse files
author
Дмитрий Фалько
committed
Voiceovers bug fix
1 parent aec6300 commit e5cb86e

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

TODO.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
- Показывать озвучки на которые подписан пользователь
2-
- Возможность написать Добавить <сериал> в этом случае список озвучек на которые подписан пользователь может быть не пустой
31
- Перенести сюда скрипт сканирующий Yandex.
42
- Сделать индексы
53
- Индекс по name сериала

src/application/ui/ui.service.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,16 @@ export class UIService {
262262

263263
subscription.serial.voiceover = subscription.serial.voiceover || [];
264264

265-
/** TODO: user can already be subscribed */
265+
/** user can already be subscribed */
266+
const fan = this.subscriptionService.findFan(user, subscription);
267+
let voiceovers = subscription.serial.voiceover;
266268

267-
for (const voiceover of subscription.serial.voiceover) {
269+
if (fan) {
270+
/** filter voiceovers user already subscribed */
271+
voiceovers = subscription.serial.voiceover.filter((voice) => !fan.voiceover.includes(voice));
272+
}
273+
274+
for (const voiceover of voiceovers) {
268275
keyboard.push([`${MESSAGE_SUBS_VOICEOVER} ${voiceover}`]);
269276
}
270277

0 commit comments

Comments
 (0)