diff options
| author | Bobby <[email protected]> | 2026-02-24 16:48:00 +0530 |
|---|---|---|
| committer | Bobby <[email protected]> | 2026-02-24 16:48:00 +0530 |
| commit | d3507ae5b9d88a250b444c0e996fa07f84f6e3c5 (patch) | |
| tree | 64680e5ba7c9b4aa2e412c5bb9611df0e940d971 /tasks/tasks.go | |
| parent | c6ff27b989047cf0af8d6cf2aa86c8e80547cf10 (diff) | |
| download | metachan-d3507ae5b9d88a250b444c0e996fa07f84f6e3c5.tar.xz metachan-d3507ae5b9d88a250b444c0e996fa07f84f6e3c5.zip | |
feat: Refactor anime and character handling
- Removed old GetAnimeEpisodes and GetAnimeEpisodesByMALID functions, replaced with a new implementation in episodes.go.
- Added GetAnimeCharacters and GetAnimeCharacter functions to handle character retrieval.
- Introduced CharacterAnimeAppearance entity to track character appearances in anime.
- Updated repositories to manage character data and enrich character details.
- Implemented enriched_at timestamp for both anime and characters to track data updates.
- Added CharacterSync task to periodically enrich character data from the Jikan API.
- Updated router to include new character-related endpoints.
Diffstat (limited to 'tasks/tasks.go')
| -rw-r--r-- | tasks/tasks.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tasks/tasks.go b/tasks/tasks.go index a60197a..707a522 100644 --- a/tasks/tasks.go +++ b/tasks/tasks.go @@ -67,6 +67,17 @@ func init() { if err != nil { logger.Errorf("TaskManager", "Failed to register AnimeSync task: %v", err) } + + err = GlobalTaskManager.RegisterTask(types.Task{ + Name: "CharacterSync", + Interval: 0, + Execute: CharacterSync, + OnResume: ResumeCharacterEnrichment, + Dependencies: []string{"AnimeSync"}, + }) + if err != nil { + logger.Errorf("TaskManager", "Failed to register CharacterSync task: %v", err) + } } // Register AnimeUpdate task (every 15 minutes) |
