Added canonical title diff

This commit is contained in:
2018-03-09 04:58:36 +01:00
parent ee04951f0e
commit 3ac77b889b
6 changed files with 71 additions and 28 deletions

View File

@ -1,35 +1,18 @@
package utils
import (
"strings"
"github.com/animenotifier/arn"
"github.com/animenotifier/mal"
)
// AnimeDiff describes a difference between two anime.
type AnimeDiff interface {
String() string
DetailsA() string
DetailsB() string
}
type AnimeGenresDiff struct {
GenresA []string
GenresB []string
}
func (diff *AnimeGenresDiff) String() string {
return "Genres are different"
}
func (diff *AnimeGenresDiff) DetailsA() string {
return strings.Join(diff.GenresA, ", ")
}
func (diff *AnimeGenresDiff) DetailsB() string {
return strings.Join(diff.GenresB, ", ")
}
// MALComparison encapsulates the difference between an ARN anime and a MAL anime.
type MALComparison struct {
Anime *arn.Anime
MALAnime *mal.Anime