refactor: обновить use case слои и интеграцию Jellyfin #55

Closed
skettiks wants to merge 1 commits from fix-develop-problems into develop
skettiks commented 2026-05-22 09:19:50 +00:00 (Migrated from github.com)

Что изменено

  • Укрупнены use case-интерфейсы: контроллеры теперь зависят от цельных FilmUseCase, UserUseCase, FilmLibraryUseCase, JellyfinSyncUseCase и т.д.
  • Обновлены контроллеры, сервисы и тесты под новые use case-контракты.
  • Логика доступных фильмов перенесена из FilmLibraryController в FilmLibraryService.
  • Добавлена проверка существования фильма при добавлении в библиотеку и отметке просмотра.
  • Переработана модель пользовательской библиотеки: FilmLibrary заменён на FilmLibraryEntry.
  • Добавлены стабильные response DTO для рекомендаций и записей библиотеки.
  • Добавлена валидация request DTO и единая обработка validation/HTTP/domain errors.
  • Исправлен /api/users/me для OAuth success redirect.
  • Убрана прямая зависимость application layer от Micrometer counters, добавлен BusinessMetricsPort.
  • Добавлены duration-метрики через @Timed и TimedAspect.
  • Улучшена Jellyfin-интеграция: транзакционная обработка событий, sync failure metrics, token-protected plugin endpoints.
  • Добавлен Jellyfin plugin в plugins/jellyfin.
  • Backend теперь принимает push-sync payload от Jellyfin-плагина.
  • Старый backend pull-sync вынесен в /api/integrations/jellyfin/pull-sync.
  • Добавлена V7__cleanup_legacy_schema.sql для legacy ratings/jellyfin_id.
  • Обновлён ER.md.

Jellyfin plugin

Плагин теперь может:

  • отправлять playback events в backend;
  • вызывать push-sync через /api/integrations/jellyfin/sync;
  • читать sync state через /api/integrations/jellyfin/sync-state;
  • использовать X-MovieNight-Plugin-Token для защиты integration endpoints
## Что изменено - Укрупнены use case-интерфейсы: контроллеры теперь зависят от цельных `FilmUseCase`, `UserUseCase`, `FilmLibraryUseCase`, `JellyfinSyncUseCase` и т.д. - Обновлены контроллеры, сервисы и тесты под новые use case-контракты. - Логика доступных фильмов перенесена из `FilmLibraryController` в `FilmLibraryService`. - Добавлена проверка существования фильма при добавлении в библиотеку и отметке просмотра. - Переработана модель пользовательской библиотеки: `FilmLibrary` заменён на `FilmLibraryEntry`. - Добавлены стабильные response DTO для рекомендаций и записей библиотеки. - Добавлена валидация request DTO и единая обработка validation/HTTP/domain errors. - Исправлен `/api/users/me` для OAuth success redirect. - Убрана прямая зависимость application layer от Micrometer counters, добавлен `BusinessMetricsPort`. - Добавлены duration-метрики через `@Timed` и `TimedAspect`. - Улучшена Jellyfin-интеграция: транзакционная обработка событий, sync failure metrics, token-protected plugin endpoints. - Добавлен Jellyfin plugin в `plugins/jellyfin`. - Backend теперь принимает push-sync payload от Jellyfin-плагина. - Старый backend pull-sync вынесен в `/api/integrations/jellyfin/pull-sync`. - Добавлена `V7__cleanup_legacy_schema.sql` для legacy `ratings`/`jellyfin_id`. - Обновлён `ER.md`. ## Jellyfin plugin Плагин теперь может: - отправлять playback events в backend; - вызывать push-sync через `/api/integrations/jellyfin/sync`; - читать sync state через `/api/integrations/jellyfin/sync-state`; - использовать `X-MovieNight-Plugin-Token` для защиты integration endpoints
coderabbitai[bot] commented 2026-05-22 09:19:58 +00:00 (Migrated from github.com)

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: fd3554d8-b70a-49ff-bca4-d4a6417e56c5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-develop-problems

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

<!-- This is an auto-generated comment: summarize by coderabbit.ai --> <!-- This is an auto-generated comment: skip review by coderabbit.ai --> > [!IMPORTANT] > ## Review skipped > > Auto reviews are disabled on base/target branches other than the default branch. > > > > Please check the settings in the CodeRabbit UI or the `.coderabbit.yaml` file in this repository. To trigger a single review, invoke the `@coderabbitai review` command. > > <details> > <summary>⚙️ Run configuration</summary> > > **Configuration used**: Organization UI > > **Review profile**: ASSERTIVE > > **Plan**: Pro > > **Run ID**: `fd3554d8-b70a-49ff-bca4-d4a6417e56c5` > > </details> > > You can disable this status message by setting the `reviews.review_status` to `false` in the CodeRabbit configuration file. > > Use the checkbox below for a quick retry: > - [ ] <!-- {"checkboxId": "e9bb8d72-00e8-4f67-9cb2-caf3b22574fe"} --> 🔍 Trigger review <!-- end of auto-generated comment: skip review by coderabbit.ai --> <!-- finishing_touch_checkbox_start --> <details> <summary>✨ Finishing Touches</summary> <details> <summary>🧪 Generate unit tests (beta)</summary> - [ ] <!-- {"checkboxId": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "radioGroupId": "utg-output-choice-group-unknown_comment_id"} --> Create PR with unit tests - [ ] <!-- {"checkboxId": "6ba7b810-9dad-11d1-80b4-00c04fd430c8", "radioGroupId": "utg-output-choice-group-unknown_comment_id"} --> Commit unit tests in branch `fix-develop-problems` </details> </details> <!-- finishing_touch_checkbox_end --> <!-- tips_start --> --- Thanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=devitq/movienight-backend&utm_content=55)! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. <details> <summary>❤️ Share</summary> - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code) </details> <sub>Comment `@coderabbitai help` to get the list of available commands and usage tips.</sub> <!-- tips_end -->

Pull request closed

This pull request cannot be reopened because the branch was deleted.
Sign in to join this conversation.