Added more inspectors for maldiff
This commit is contained in:
33
utils/animediff/EndDate.go
Normal file
33
utils/animediff/EndDate.go
Normal file
@ -0,0 +1,33 @@
|
||||
package animediff
|
||||
|
||||
// EndDate describes differing Romaji titles.
|
||||
type EndDate struct {
|
||||
DateA string
|
||||
DateB string
|
||||
NumericHash uint64
|
||||
}
|
||||
|
||||
// Type returns the diff type.
|
||||
func (diff *EndDate) Type() string {
|
||||
return "EndDate"
|
||||
}
|
||||
|
||||
// Explanation returns the description.
|
||||
func (diff *EndDate) Explanation() string {
|
||||
return "End dates are different"
|
||||
}
|
||||
|
||||
// DetailsA shows the details for the first anime.
|
||||
func (diff *EndDate) DetailsA() string {
|
||||
return diff.DateA
|
||||
}
|
||||
|
||||
// DetailsB shows the details for the second anime.
|
||||
func (diff *EndDate) DetailsB() string {
|
||||
return diff.DateB
|
||||
}
|
||||
|
||||
// Hash returns the hash for the suggested value (from anime B).
|
||||
func (diff *EndDate) Hash() uint64 {
|
||||
return diff.NumericHash
|
||||
}
|
35
utils/animediff/EpisodeCount.go
Normal file
35
utils/animediff/EpisodeCount.go
Normal file
@ -0,0 +1,35 @@
|
||||
package animediff
|
||||
|
||||
import "strconv"
|
||||
|
||||
// EpisodeCount ...
|
||||
type EpisodeCount struct {
|
||||
EpisodesA int
|
||||
EpisodesB int
|
||||
NumericHash uint64
|
||||
}
|
||||
|
||||
// Type returns the diff type.
|
||||
func (diff *EpisodeCount) Type() string {
|
||||
return "EpisodeCount"
|
||||
}
|
||||
|
||||
// Explanation returns the description.
|
||||
func (diff *EpisodeCount) Explanation() string {
|
||||
return "Episode counts are different"
|
||||
}
|
||||
|
||||
// DetailsA shows the details for the first anime.
|
||||
func (diff *EpisodeCount) DetailsA() string {
|
||||
return strconv.Itoa(diff.EpisodesA)
|
||||
}
|
||||
|
||||
// DetailsB shows the details for the second anime.
|
||||
func (diff *EpisodeCount) DetailsB() string {
|
||||
return strconv.Itoa(diff.EpisodesB)
|
||||
}
|
||||
|
||||
// Hash returns the hash for the suggested value (from anime B).
|
||||
func (diff *EpisodeCount) Hash() uint64 {
|
||||
return diff.NumericHash
|
||||
}
|
33
utils/animediff/RomajiTitle.go
Normal file
33
utils/animediff/RomajiTitle.go
Normal file
@ -0,0 +1,33 @@
|
||||
package animediff
|
||||
|
||||
// RomajiTitle describes differing Romaji titles.
|
||||
type RomajiTitle struct {
|
||||
TitleA string
|
||||
TitleB string
|
||||
NumericHash uint64
|
||||
}
|
||||
|
||||
// Type returns the diff type.
|
||||
func (diff *RomajiTitle) Type() string {
|
||||
return "RomajiTitle"
|
||||
}
|
||||
|
||||
// Explanation returns the description.
|
||||
func (diff *RomajiTitle) Explanation() string {
|
||||
return "Romaji titles are different"
|
||||
}
|
||||
|
||||
// DetailsA shows the details for the first anime.
|
||||
func (diff *RomajiTitle) DetailsA() string {
|
||||
return diff.TitleA
|
||||
}
|
||||
|
||||
// DetailsB shows the details for the second anime.
|
||||
func (diff *RomajiTitle) DetailsB() string {
|
||||
return diff.TitleB
|
||||
}
|
||||
|
||||
// Hash returns the hash for the suggested value (from anime B).
|
||||
func (diff *RomajiTitle) Hash() uint64 {
|
||||
return diff.NumericHash
|
||||
}
|
33
utils/animediff/StartDate.go
Normal file
33
utils/animediff/StartDate.go
Normal file
@ -0,0 +1,33 @@
|
||||
package animediff
|
||||
|
||||
// StartDate describes differing Romaji titles.
|
||||
type StartDate struct {
|
||||
DateA string
|
||||
DateB string
|
||||
NumericHash uint64
|
||||
}
|
||||
|
||||
// Type returns the diff type.
|
||||
func (diff *StartDate) Type() string {
|
||||
return "StartDate"
|
||||
}
|
||||
|
||||
// Explanation returns the description.
|
||||
func (diff *StartDate) Explanation() string {
|
||||
return "Start dates are different"
|
||||
}
|
||||
|
||||
// DetailsA shows the details for the first anime.
|
||||
func (diff *StartDate) DetailsA() string {
|
||||
return diff.DateA
|
||||
}
|
||||
|
||||
// DetailsB shows the details for the second anime.
|
||||
func (diff *StartDate) DetailsB() string {
|
||||
return diff.DateB
|
||||
}
|
||||
|
||||
// Hash returns the hash for the suggested value (from anime B).
|
||||
func (diff *StartDate) Hash() uint64 {
|
||||
return diff.NumericHash
|
||||
}
|
33
utils/animediff/Status.go
Normal file
33
utils/animediff/Status.go
Normal file
@ -0,0 +1,33 @@
|
||||
package animediff
|
||||
|
||||
// Status describes differing Romaji titles.
|
||||
type Status struct {
|
||||
StatusA string
|
||||
StatusB string
|
||||
NumericHash uint64
|
||||
}
|
||||
|
||||
// Type returns the diff type.
|
||||
func (diff *Status) Type() string {
|
||||
return "Status"
|
||||
}
|
||||
|
||||
// Explanation returns the description.
|
||||
func (diff *Status) Explanation() string {
|
||||
return "Status is different"
|
||||
}
|
||||
|
||||
// DetailsA shows the details for the first anime.
|
||||
func (diff *Status) DetailsA() string {
|
||||
return diff.StatusA
|
||||
}
|
||||
|
||||
// DetailsB shows the details for the second anime.
|
||||
func (diff *Status) DetailsB() string {
|
||||
return diff.StatusB
|
||||
}
|
||||
|
||||
// Hash returns the hash for the suggested value (from anime B).
|
||||
func (diff *Status) Hash() uint64 {
|
||||
return diff.NumericHash
|
||||
}
|
Reference in New Issue
Block a user