Skip to content

Conversation

@Ziedelth
Copy link
Contributor

@Ziedelth Ziedelth commented Jan 9, 2026

No description provided.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Ziedelth, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly expands the application's data model by adding robust support for genres and tags for anime. It establishes the necessary database structures, data transfer objects, and business logic to manage these classifications. A key aspect of this change is the integration with AniList, enabling automatic fetching and maintenance of genre and tag data, thereby enriching the anime information available within the system. The administrative interface has also been updated to present this new data, enhancing content management capabilities.

Highlights

  • New Database Schema for Genres and Tags: Introduced new Genre and Tag entities, along with an AnimeTag entity to manage the relationship between anime and tags, including metadata like isAdult and isSpoiler. Corresponding DTOs, factories, and repositories have been created for these new entities.
  • Anime Entity and DTO Updates: The Anime entity now includes genres (many-to-many) and tags (one-to-many with AnimeTag) relationships. The AnimeDto has also been updated to reflect these new fields, allowing genre and tag information to be exposed through the API.
  • AniList Integration for Genre and Tag Data: The UpdateAnimeJob has been enhanced to automatically fetch and synchronize genre and tag data from AniList for each anime. This includes logic to add, update, and remove genres and tags, as well as their associated metadata (e.g., isAdult, isSpoiler).
  • AniList Matching Job Enhancements: The AniListMatchingJob now supports matching against multiple simulcast UUIDs and introduces a new configurable property, ANILIST_SIMULCAST_MATCHING_SIZE, to control the number of simulcasts considered for matching.
  • Admin UI Updates: The anime edit page in the admin interface (edit.ftl) has been updated to display the newly integrated genre and tag information, providing a clear overview of an anime's classifications, including visual indicators for adult and spoiler tags.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
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 is a great addition, introducing comprehensive support for genres and tags. The changes span the entire stack, from database schema and entities to services, AniList integration, and UI updates. The code is well-structured and the new features are implemented thoughtfully. I have identified a few areas for improvement, including a potential bug, a typo, and opportunities to make the caching logic more robust. Overall, excellent work.

Comment on lines +32 to +33
val genres = genreCacheService.findAllByAnime(entity.uuid)
val tags = animeTagCacheService.findAllByAnime(entity.uuid)
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The entity.uuid property is nullable (UUID?), but it's being passed to findAllByAnime in GenreCacheService and AnimeTagCacheService, both of which expect a non-nullable UUID. This could lead to a NullPointerException if an anime entity ever has a null UUID at this stage.

To ensure type safety and prevent potential runtime errors, you should use the non-null assertion operator (!!), similar to how it's used for animeCacheService.getAudioLocales(entity.uuid!!) on line 29.

Suggested change
val genres = genreCacheService.findAllByAnime(entity.uuid)
val tags = animeTagCacheService.findAllByAnime(entity.uuid)
val genres = genreCacheService.findAllByAnime(entity.uuid!!)
val tags = animeTagCacheService.findAllByAnime(entity.uuid!!)


fun findAllByAnime(animeUuid: UUID) = MapCache.getOrCompute(
"AnimeTagCacheService.findAllByAnime",
classes = listOf(AnimeTag::class.java, Tag::class.java),
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The findAllByAnime method in AnimeTagRepository queries based on the Anime entity. Therefore, the cache for AnimeTagCacheService.findAllByAnime should be invalidated not only when AnimeTag or Tag entities change, but also when Anime entities change. Adding Anime::class.java to the list of classes for cache invalidation will make the caching mechanism more robust and prevent stale data issues.

Suggested change
classes = listOf(AnimeTag::class.java, Tag::class.java),
classes = listOf(Anime::class.java, AnimeTag::class.java, Tag::class.java),


fun findAllByAnime(animeUuid: UUID) = MapCache.getOrCompute(
"GenreCacheService.findAllByAnime",
classes = listOf(Genre::class.java),
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The findAllByAnime method in GenreRepository queries through the Anime entity to find associated genres. This means the cache for GenreCacheService.findAllByAnime is dependent on changes in Anime entities as well. To ensure the cache is properly invalidated and avoid serving stale data, you should add Anime::class.java to the list of dependency classes.

Suggested change
classes = listOf(Genre::class.java),
classes = listOf(Anime::class.java, Genre::class.java),

import java.util.*

class AnimeTagService : AbstractService<AnimeTag, AnimeTagRepository>() {
@Inject private lateinit var genranimeTagRepositoryRepository: AnimeTagRepository
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

There's a typo in the variable name genranimeTagRepositoryRepository. It should be animeTagRepository for consistency and better readability.

Suggested change
@Inject private lateinit var genranimeTagRepositoryRepository: AnimeTagRepository
@Inject private lateinit var animeTagRepository: AnimeTagRepository

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.

2 participants