This repository was archived by the owner on Dec 26, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 1
- - Показывать озвучки на которые подписан пользователь
2
- - Возможность написать Добавить <сериал> в этом случае список озвучек на которые подписан пользователь может быть не пустой
3
1
- Перенести сюда скрипт сканирующий Yandex.
4
2
- Сделать индексы
5
3
- Индекс по name сериала
Original file line number Diff line number Diff line change @@ -262,9 +262,16 @@ export class UIService {
262
262
263
263
subscription . serial . voiceover = subscription . serial . voiceover || [ ] ;
264
264
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 ;
266
268
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 ) {
268
275
keyboard . push ( [ `${ MESSAGE_SUBS_VOICEOVER } ${ voiceover } ` ] ) ;
269
276
}
270
277
You can’t perform that action at this time.
0 commit comments