aboutsummaryrefslogtreecommitdiff
path: root/entities/genre.go
diff options
context:
space:
mode:
authorBobby <[email protected]>2026-02-06 17:45:55 +0530
committerBobby <[email protected]>2026-02-06 17:45:55 +0530
commit2da45b9fbf74d365951e37a4152f30e76caaeb98 (patch)
tree8fc9b5f02d37194c136e7f757f1e37c21825094c /entities/genre.go
parent8cb229a3bc07387067ca76a34c05b44ff7a3039a (diff)
downloadmetachan-2da45b9fbf74d365951e37a4152f30e76caaeb98.tar.xz
metachan-2da45b9fbf74d365951e37a4152f30e76caaeb98.zip
Refactor task management and producer synchronization
- Updated TaskManager to utilize repositories for database operations, improving separation of concerns. - Enhanced logging functionality by replacing logger.Log with logger.Infof, logger.Warnf, and logger.Errorf for better readability and consistency. - Simplified ProducerSync function by removing unnecessary pagination logic and directly fetching producer data. - Introduced helper functions for calculating progress and managing task statuses. - Added new service for fetching and saving anime data, integrating multiple data sources (Jikan, Anilist, MALsync, TMDB, TVDB, Aniskip). - Created new types for task management and improved overall code organization. - Removed deprecated database calls and replaced them with repository methods for better maintainability.
Diffstat (limited to 'entities/genre.go')
-rw-r--r--entities/genre.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/entities/genre.go b/entities/genre.go
index f8763b3..ed906ca 100644
--- a/entities/genre.go
+++ b/entities/genre.go
@@ -5,7 +5,7 @@ import "gorm.io/gorm"
type Genre struct {
gorm.Model
Name string `json:"name,omitempty"`
- GenreID int `json:"genre_id,omitempty"`
+ GenreID int `gorm:"uniqueIndex" json:"genre_id,omitempty"`
URL string `json:"url,omitempty"`
Count int `gorm:"default:0" json:"count,omitempty"`
Anime []Anime `gorm:"many2many:anime_genres;" json:"anime,omitempty"`