From 8cc063b4f65c2181fde4c567f2cdc82a75cca9bf Mon Sep 17 00:00:00 2001 From: Bobby Date: Tue, 6 May 2025 22:41:12 +0530 Subject: additional data and seasons --- database/anime.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'database') diff --git a/database/anime.go b/database/anime.go index 9f2c26f..44382bf 100644 --- a/database/anime.go +++ b/database/anime.go @@ -9,3 +9,12 @@ func GetAnimeMappingViaMALID(malID int) (*entities.AnimeMapping, error) { } return &mapping, nil } + +// GetAnimeMappingsByTVDBID retrieves all anime mappings that share the same TVDB ID +func GetAnimeMappingsByTVDBID(tvdbID int) ([]entities.AnimeMapping, error) { + var mappings []entities.AnimeMapping + if err := DB.Where("tvdb = ?", tvdbID).Find(&mappings).Error; err != nil { + return nil, err + } + return mappings, nil +} -- cgit v1.2.3