Skip to content

feat: add batch filtering for followed episodes and API endpoint#1399

Open
Ziedelth wants to merge 1 commit into
masterfrom
feat/1390
Open

feat: add batch filtering for followed episodes and API endpoint#1399
Ziedelth wants to merge 1 commit into
masterfrom
feat/1390

Conversation

@Ziedelth
Copy link
Copy Markdown
Contributor

  • Introduced filterFollowedEpisodeUUIDs method in MemberFollowEpisodeService and repository.
  • Added /me/watched-episodes/batch POST endpoint in MemberController for batch processing of followed episodes.
  • Implemented validation for empty and oversized episode lists.
  • Provided comprehensive test cases for the new functionality.

@Ziedelth Ziedelth linked an issue May 28, 2026 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new batch endpoint /me/watched-episodes/batch in MemberController to filter followed episode UUIDs, along with the corresponding repository and service layer implementations and integration tests. The review feedback suggests renaming the controller method to accurately reflect its filtering behavior rather than implying it performs a "follow" action, and adding an early return in the repository method when the input list is empty to avoid unnecessary database queries.

Comment thread src/main/kotlin/fr/shikkanime/controllers/api/MemberController.kt Outdated
Comment on lines +64 to +65
suspend fun filterFollowedEpisodeUUIDs(memberUuid: UUID, list: List<UUID>): List<UUID> {
return dispatch {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

If list is empty, executing the database query is unnecessary and could potentially lead to SQL syntax errors depending on the database dialect's handling of empty IN clauses. Adding an early return for empty lists improves efficiency and robustness.

Suggested change
suspend fun filterFollowedEpisodeUUIDs(memberUuid: UUID, list: List<UUID>): List<UUID> {
return dispatch {
suspend fun filterFollowedEpisodeUUIDs(memberUuid: UUID, list: List<UUID>): List<UUID> {
if (list.isEmpty()) return emptyList()
return dispatch {

- Introduced `filterFollowedEpisodeUUIDs` method in `MemberFollowEpisodeService` and repository.
- Added `/me/watched-episodes/batch` POST endpoint in `MemberController` for batch processing of followed episodes.
- Implemented validation for empty and oversized episode lists.
- Provided comprehensive test cases for the new functionality.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 28, 2026

Qodana for JVM

5 new problems were found

Inspection name Severity Problems
Unused symbol 🔶 Warning 5

☁️ View the detailed Qodana report

Contact Qodana team

Contact us at qodana-support@jetbrains.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create POST /api/v1/members/me/watched-episodes/batch

1 participant