aboutsummaryrefslogtreecommitdiff
path: root/database
diff options
context:
space:
mode:
authorBobby <[email protected]>2025-05-06 22:41:12 +0530
committerBobby <[email protected]>2025-05-06 22:41:12 +0530
commit8cc063b4f65c2181fde4c567f2cdc82a75cca9bf (patch)
treeed313f5f694491467e727a9e604531c9dc0a3ecf /database
parent8fa6d4dd33abe412bb09af949810ee0a1f9678bf (diff)
downloadmetachan-8cc063b4f65c2181fde4c567f2cdc82a75cca9bf.tar.xz
metachan-8cc063b4f65c2181fde4c567f2cdc82a75cca9bf.zip
additional data and seasons
Diffstat (limited to 'database')
-rw-r--r--database/anime.go9
1 files changed, 9 insertions, 0 deletions
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
+}