]> git.lizzy.rs Git - go-anidb.git/commitdiff
anidb: Move EpisodeCount struct to misc
authorDiogo Franco (Kovensky) <diogomfranco@gmail.com>
Tue, 16 Jul 2013 16:02:26 +0000 (13:02 -0300)
committerDiogo Franco (Kovensky) <diogomfranco@gmail.com>
Tue, 16 Jul 2013 16:02:26 +0000 (13:02 -0300)
anime.go
animecache.go
misc/episodelist.go

index 5e5c4b7c997f6c2bb8623bdf1a6c78917f7b3441..dad32e31eac9094f506c176884ce71ef51ec4121 100644 (file)
--- 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 {
index 30cf3d043e30925147e38d16a9cace098237a98e..b223fe3a4028405faac153700f6cab1c276b0cda 100644 (file)
@@ -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],
index 877ac4a9ea86e82a4ec722d2125df597fc5f39e4..91ba7cc1fddc4f291333b1a45b5656696146578e 100644 (file)
@@ -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.