Use AnimeID type

This commit is contained in:
2019-06-07 10:50:38 +09:00
parent a3f04fbd2f
commit 18a7be18d2
12 changed files with 41 additions and 35 deletions

View File

@ -30,12 +30,12 @@ func GetIgnoreAnimeDifference(id string) (*IgnoreAnimeDifference, error) {
}
// CreateDifferenceID ...
func CreateDifferenceID(animeID string, dataProvider string, malAnimeID string, typeName string) string {
func CreateDifferenceID(animeID AnimeID, dataProvider string, malAnimeID string, typeName string) string {
return fmt.Sprintf("arn:%s|%s:%s|%s", animeID, dataProvider, malAnimeID, typeName)
}
// IsAnimeDifferenceIgnored tells you whether the given difference is being ignored.
func IsAnimeDifferenceIgnored(animeID string, dataProvider string, malAnimeID string, typeName string, hash uint64) bool {
func IsAnimeDifferenceIgnored(animeID AnimeID, dataProvider string, malAnimeID string, typeName string, hash uint64) bool {
key := CreateDifferenceID(animeID, dataProvider, malAnimeID, typeName)
ignore, err := GetIgnoreAnimeDifference(key)