From cb14d54ee1d656c385247a35811c4ec1ec38a6cb Mon Sep 17 00:00:00 2001 From: "Diogo Franco (Kovensky)" Date: Tue, 16 Jul 2013 13:02:26 -0300 Subject: [PATCH] anidb: Move EpisodeCount struct to misc --- anime.go | 15 +++------------ animecache.go | 2 +- misc/episodelist.go | 9 +++++++++ 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/anime.go b/anime.go index 5e5c4b7..dad32e3 100644 --- a/anime.go +++ b/anime.go @@ -49,9 +49,9 @@ type Anime struct { AID AID // The Anime ID. R18 bool // Whether this anime is considered porn. - Type AnimeType // Production/distribution type. - TotalEpisodes int // Total number of regular episodes. - EpisodeCount EpisodeCount // Known numbers of the various types of episodes. + Type AnimeType // Production/distribution type. + TotalEpisodes int // Total number of regular episodes. + EpisodeCount misc.EpisodeCount // Known numbers of the various types of episodes. StartDate time.Time // Date of first episode release, if available. EndDate time.Time // Date of last episode release, if available. @@ -80,15 +80,6 @@ type Anime struct { Cached time.Time // When the data was retrieved from the server. } -type EpisodeCount struct { - RegularCount int - SpecialCount int - CreditsCount int - OtherCount int - TrailerCount int - ParodyCount int -} - // Convenience method that runs AnimeByID on the result of // SearchAnime. func (adb *AniDB) AnimeByName(name string) <-chan *Anime { diff --git a/animecache.go b/animecache.go index 30cf3d0..b223fe3 100644 --- a/animecache.go +++ b/animecache.go @@ -248,7 +248,7 @@ func (a *Anime) populateFromHTTP(reply httpapi.Anime) bool { a.Episodes = append(a.Episodes, e) } - a.EpisodeCount = EpisodeCount{ + a.EpisodeCount = misc.EpisodeCount{ RegularCount: counts[misc.EpisodeTypeRegular], SpecialCount: counts[misc.EpisodeTypeSpecial], CreditsCount: counts[misc.EpisodeTypeCredits], diff --git a/misc/episodelist.go b/misc/episodelist.go index 877ac4a..91ba7cc 100644 --- a/misc/episodelist.go +++ b/misc/episodelist.go @@ -6,6 +6,15 @@ import ( "strings" ) +type EpisodeCount struct { + RegularCount int + SpecialCount int + CreditsCount int + OtherCount int + TrailerCount int + ParodyCount int +} + type EpisodeList []*EpisodeRange // Converts the EpisodeList into the AniDB API list format. -- 2.44.0