]> git.lizzy.rs Git - go-anidb.git/commitdiff
anidb: Update documentation / comments
authorDiogo Franco (Kovensky) <diogomfranco@gmail.com>
Tue, 16 Jul 2013 17:06:32 +0000 (14:06 -0300)
committerDiogo Franco (Kovensky) <diogomfranco@gmail.com>
Tue, 16 Jul 2013 17:06:32 +0000 (14:06 -0300)
anidb.go
episodecache.go

index 491f667f4b96798781ee5c48dd90dd45a5f1ff65..ee0e0c98dd85c6fb47f262ed0909fd8cfb9a1e78 100644 (file)
--- a/anidb.go
+++ b/anidb.go
@@ -11,6 +11,9 @@ import (
 // from the cache. If the sought object isn't cached, or if the cache is
 // stale, then the appropriate API is queried.
 //
+// Queries return their results using channels. Most queries only have one result,
+// but some have 0 or more. All result channels are closed after sending their data.
+//
 // Queries that depend on the UDP API can't be used without first authenticating
 // to the API server. This uses the credentials stored by SetCredentials, or
 // by a previous Auth() call.
index cd2e4aa0c6d4a17e6d48677cb9249e2c6155e68b..32fb01d219e7fb27552b448f3569daf71f032e46 100644 (file)
@@ -72,8 +72,10 @@ func (adb *AniDB) EpisodeByID(eid EID) <-chan *Episode {
        }
 
        go func() {
-               // The UDP API data is worse than the HTTP API anime data,
-               // try and get from the corresponding Anime
+               // The UDP API data is worse than the HTTP API anime data and
+               // might even get truncated on some pathological cases;
+               // try and get from the corresponding Anime, which uses the HTTP
+               // API episode list.
 
                aid := AID(0)
                ok := cache.Get(&aid, "aid", "by-eid", eid) == nil