2018-03-09 04:12:22 +00:00
|
|
|
package animediff
|
2018-03-09 03:58:36 +00:00
|
|
|
|
|
|
|
import "strings"
|
|
|
|
|
2018-03-09 04:12:22 +00:00
|
|
|
// Genres describes differing genres.
|
|
|
|
type Genres struct {
|
2018-03-09 13:48:00 +00:00
|
|
|
GenresA []string
|
|
|
|
GenresB []string
|
|
|
|
NumericHash uint64
|
2018-03-09 03:58:36 +00:00
|
|
|
}
|
|
|
|
|
2018-03-09 12:42:45 +00:00
|
|
|
// Type returns the diff type.
|
|
|
|
func (diff *Genres) Type() string {
|
|
|
|
return "Genres"
|
|
|
|
}
|
|
|
|
|
|
|
|
// Explanation returns the description.
|
|
|
|
func (diff *Genres) Explanation() string {
|
2018-03-09 03:58:36 +00:00
|
|
|
return "Genres are different"
|
|
|
|
}
|
|
|
|
|
|
|
|
// DetailsA shows the details for the first anime.
|
2018-03-09 04:12:22 +00:00
|
|
|
func (diff *Genres) DetailsA() string {
|
2018-03-09 03:58:36 +00:00
|
|
|
return strings.Join(diff.GenresA, ", ")
|
|
|
|
}
|
|
|
|
|
|
|
|
// DetailsB shows the details for the second anime.
|
2018-03-09 04:12:22 +00:00
|
|
|
func (diff *Genres) DetailsB() string {
|
2018-03-09 03:58:36 +00:00
|
|
|
return strings.Join(diff.GenresB, ", ")
|
|
|
|
}
|
2018-03-09 13:48:00 +00:00
|
|
|
|
|
|
|
// Hash returns the hash for the suggested value (from anime B).
|
|
|
|
func (diff *Genres) Hash() uint64 {
|
|
|
|
return diff.NumericHash
|
|
|
|
}
|