]> git.lizzy.rs Git - go-anidb.git/commitdiff
anidb: Add AnimeCount() call
authorDiogo Franco (Kovensky) <diogomfranco@gmail.com>
Fri, 26 Jul 2013 23:32:13 +0000 (20:32 -0300)
committerDiogo Franco (Kovensky) <diogomfranco@gmail.com>
Fri, 26 Jul 2013 23:32:13 +0000 (20:32 -0300)
titlecache.go

index d5356d87c5a925b5ed2edd3b89935fa2d1849e21..a77ba5275d8759449495dac0a84b0dc23568489d 100644 (file)
@@ -34,6 +34,11 @@ func TitlesUpToDate() (ok bool) {
        return time.Now().Sub(titlesDB.UpdateTime) < 24*time.Hour
 }
 
+// Returns the number of anime in the titles database
+func AnimeCount() int {
+       return len(titlesDB.AnimeMap)
+}
+
 // Downloads a new anime-titles database if the database is outdated.
 //
 // Saves the database as anime-titles.dat.gz in the cache dir.