]>
git.lizzy.rs Git - go-anidb.git/log
summary |
shortlog | log |
commit |
commitdiff |
tree
first ⋅ prev ⋅ next
Diogo Franco (Kovensky) [Tue, 16 Jul 2013 17:03:32 +0000 (14:03 -0300)]
anidb: Change retry timer factors
Now gives a progression of 10s, 20s, 40s and 60s waits.
Diogo Franco (Kovensky) [Tue, 16 Jul 2013 17:02:50 +0000 (14:02 -0300)]
anidb: Remove unused struct errorReply
Diogo Franco (Kovensky) [Tue, 16 Jul 2013 17:02:35 +0000 (14:02 -0300)]
anidb: Delete params s and tag from retries
These get added by (*udpapi.AniDBUDP).SendRecv(); we don't want to show
them in the log.
Diogo Franco (Kovensky) [Tue, 16 Jul 2013 17:01:34 +0000 (14:01 -0300)]
anidb: Handle UDP API 601 (server down)
We treat it the same as a ban: wait 30 minutes before allowing any
packets through.
Diogo Franco (Kovensky) [Tue, 16 Jul 2013 17:00:26 +0000 (14:00 -0300)]
anidb: Handle invalid AID HTTP API response
Diogo Franco (Kovensky) [Tue, 16 Jul 2013 17:00:02 +0000 (14:00 -0300)]
anidb: Support files with partial/multiple episodes
Correct the parsing of OtherEpisodes, rename to RelatedEpisodes. Remove
old debug logging.
Diogo Franco (Kovensky) [Tue, 16 Jul 2013 16:57:49 +0000 (13:57 -0300)]
anidb: Support FilesByGroup/FilesByGID
Takes an Episode, for its recorded AID and episode number data.
Also includes helper method FIDsByGID.
Diogo Franco (Kovensky) [Tue, 16 Jul 2013 16:52:51 +0000 (13:52 -0300)]
misc: Support partial episodes
Diogo Franco (Kovensky) [Tue, 16 Jul 2013 16:50:18 +0000 (13:50 -0300)]
anidb: Simplify (*AniDB).EpisodeByID()
Use (*Anime).EpisodeByEID() to search for the requested episode.
Diogo Franco (Kovensky) [Tue, 16 Jul 2013 16:48:23 +0000 (13:48 -0300)]
anidb: Log HTTP API traffic
Diogo Franco (Kovensky) [Tue, 16 Jul 2013 16:46:40 +0000 (13:46 -0300)]
anidb: Log UDP traffic
But only the first line of replies. ReAuth and Logout need special
handling since they don't use the sendQueue.
Diogo Franco (Kovensky) [Tue, 16 Jul 2013 16:43:45 +0000 (13:43 -0300)]
udp, anidb: Lock shared data, return APIReply for authentication
Makes error reporting easier.
Diogo Franco (Kovensky) [Tue, 16 Jul 2013 16:34:16 +0000 (13:34 -0300)]
misc: Add FormatLog method to Episode/EpisodeList/EpisodeRange
EpisodeList.FormatLog takes an EpisodeCount instead of an int; and each
subrange is formatted according to the log of the count for its own
type.
Diogo Franco (Kovensky) [Tue, 16 Jul 2013 16:25:51 +0000 (13:25 -0300)]
anidb: Refactor the intent map
Allows notifications without closing the channels. All current users of
Notify were changed to NotifyClose.
Diogo Franco (Kovensky) [Tue, 16 Jul 2013 16:20:22 +0000 (13:20 -0300)]
anidb: Add logging to titlecache, be more careful with caching
Only cache the new anime-titles.dat.gz (thus truncating an older one) if
we can download it entirely to memory (it's little less than 600KB).
Diogo Franco (Kovensky) [Tue, 16 Jul 2013 16:18:19 +0000 (13:18 -0300)]
anidb: (*Anime).Episode(): be more helpful in the panic message
Diogo Franco (Kovensky) [Tue, 16 Jul 2013 16:17:28 +0000 (13:17 -0300)]
anidb: Remove debug logging from cache
Diogo Franco (Kovensky) [Tue, 16 Jul 2013 16:16:54 +0000 (13:16 -0300)]
anidb: Immediately return error for clearly invalid IDs
Diogo Franco (Kovensky) [Tue, 16 Jul 2013 16:02:26 +0000 (13:02 -0300)]
anidb: Move EpisodeCount struct to misc
Diogo Franco (Kovensky) [Tue, 16 Jul 2013 15:58:52 +0000 (12:58 -0300)]
anidb: Add (*Anime).EpisodeByEID
Also remove redundant type Episodes []*Episode -- the Episodes type
didn't have any methods.
Diogo Franco (Kovensky) [Tue, 16 Jul 2013 15:39:12 +0000 (12:39 -0300)]
http, udp: Remove debug logging
Keep complaints about unknown resource types though, but mention that it
comes from the HTTP API.
Diogo Franco (Kovensky) [Mon, 15 Jul 2013 15:41:55 +0000 (12:41 -0300)]
anidb: rename ed2kCache to fidCache
Diogo Franco (Kovensky) [Mon, 15 Jul 2013 15:41:07 +0000 (12:41 -0300)]
misc: Fix Episode<->Episode comparison
Diogo Franco (Kovensky) [Mon, 15 Jul 2013 13:40:03 +0000 (10:40 -0300)]
anidb: Change Episodes to be []*Episode
Diogo Franco (Kovensky) [Mon, 15 Jul 2013 04:26:58 +0000 (01:26 -0300)]
anidb: Add missing loop 'break's to EpisodeByEID
Without the breaks, it's would be possible to query for an Anime
with AID 0, a clear waste of time.
Also move the 'ok = false' assignment closer to where it's documented.
Diogo Franco (Kovensky) [Mon, 15 Jul 2013 04:25:55 +0000 (01:25 -0300)]
anidb: Always remove credentials on Logout()
Even if they were never used.
Diogo Franco (Kovensky) [Mon, 15 Jul 2013 04:25:32 +0000 (01:25 -0300)]
anidb: Document that credentials are needed for UDP queries
Commit messages aren't documentation :(
Diogo Franco (Kovensky) [Mon, 15 Jul 2013 04:21:38 +0000 (01:21 -0300)]
anidb: Document which backend API is used on the Get* methods
Queries that depend on the UDP API can't be used without SetCredentials.
Diogo Franco (Kovensky) [Mon, 15 Jul 2013 04:11:53 +0000 (01:11 -0300)]
anidb: Fix compilation
Diogo Franco (Kovensky) [Mon, 15 Jul 2013 04:09:51 +0000 (01:09 -0300)]
anidb: Check the HTTP API error as well for deleting invalid Anime
Diogo Franco (Kovensky) [Mon, 15 Jul 2013 04:07:27 +0000 (01:07 -0300)]
anidb: Delete invalid cache data
If the API queries return errors specifically stating that requested
object doesn't exist, then delete the entry from the local cache.
Diogo Franco (Kovensky) [Mon, 15 Jul 2013 04:06:01 +0000 (01:06 -0300)]
anidb: Return the previously available data if API refresh failed
Makes the GetObjectByKey family of methods behave better if the API
is somehow unavailable.
Diogo Franco (Kovensky) [Mon, 15 Jul 2013 04:03:41 +0000 (01:03 -0300)]
anidb: Simplify documentation
Diogo Franco (Kovensky) [Mon, 15 Jul 2013 03:27:04 +0000 (00:27 -0300)]
anidb: Wait longer after each UDP API timeout
Reset the wait after the first successful read.
Diogo Franco (Kovensky) [Mon, 15 Jul 2013 03:26:29 +0000 (00:26 -0300)]
anidb: Implement GroupByName
Also add the invalid key guard to GroupByID.
Diogo Franco (Kovensky) [Mon, 15 Jul 2013 03:22:20 +0000 (00:22 -0300)]
anidb: fix ed2k caching
Don't embed time.Time in the cache struct -- time.Time has its own
GobEncode and GobDecode methods, and we don't want them to be used.
Diogo Franco (Kovensky) [Mon, 15 Jul 2013 03:21:54 +0000 (00:21 -0300)]
anidb: Fix cache_test.go compilation
Diogo Franco (Kovensky) [Sun, 14 Jul 2013 05:07:29 +0000 (02:07 -0300)]
anidb: Remove commented out code
Diogo Franco (Kovensky) [Sun, 14 Jul 2013 05:04:35 +0000 (02:04 -0300)]
anidb: (*cacheDir).Get(): reduce the time a file lock is retained
When reading from cache, read the entire file into a buffer before
attempting to decode; release the lock as soon as the read is done.
Also move the parameter sanity check to be earlier in the method.
Diogo Franco (Kovensky) [Sun, 14 Jul 2013 04:54:46 +0000 (01:54 -0300)]
anidb: Fix compilation of flock_other
Also fixes inverted if test.
Diogo Franco (Kovensky) [Sun, 14 Jul 2013 04:54:16 +0000 (01:54 -0300)]
anidb: Don't use a nil fileLock
Diogo Franco (Kovensky) [Sun, 14 Jul 2013 15:42:42 +0000 (12:42 -0300)]
anidb: Update documentation
Diogo Franco (Kovensky) [Sun, 14 Jul 2013 15:41:29 +0000 (12:41 -0300)]
anidb: panic if the default cache dir can't be set
Nothing works without a valid cache.
Diogo Franco (Kovensky) [Sun, 14 Jul 2013 15:40:53 +0000 (12:40 -0300)]
anidb: Correct accidental docstring
Diogo Franco (Kovensky) [Sun, 14 Jul 2013 23:20:41 +0000 (20:20 -0300)]
anidb: Support searching for multiple Episodes in an Anime
Diogo Franco (Kovensky) [Sun, 14 Jul 2013 23:19:51 +0000 (20:19 -0300)]
anidb: Don't send UDP queries if we have no credentials
We'd just get a 501 error and wouldn't be able to do anything about it.
Skip the middleman and return the 501 right away.
Diogo Franco (Kovensky) [Sun, 14 Jul 2013 23:16:42 +0000 (20:16 -0300)]
anidb: New caching mechanism
Refactors the various parts of the code that interacted with the cache
to use the new cache. Moves the intent system to be decoupled from the
cache.
Caches requests made with invalid keys, avoids requerying the API for
InvalidKeyCacheDuration (1 hour).
Untested on !windows, since that uses a separate file locking mechanism.
Diogo Franco (Kovensky) [Sun, 14 Jul 2013 18:03:46 +0000 (15:03 -0300)]
anidb: Make cached *File expire earlier if they're Incomplete
Diogo Franco (Kovensky) [Sun, 14 Jul 2013 18:01:38 +0000 (15:01 -0300)]
anime: Make cached Anime expire earlier if they're Incomplete
Diogo Franco (Kovensky) [Sun, 14 Jul 2013 17:58:00 +0000 (14:58 -0300)]
anime: Consistently name the *AniDB "adb" in *AniDB methods
Makes the docs look better.
Diogo Franco (Kovensky) [Sun, 14 Jul 2013 17:55:31 +0000 (14:55 -0300)]
anidb: Remove (*AniDB).ReAuth() method
Diogo Franco (Kovensky) [Sun, 14 Jul 2013 17:52:40 +0000 (14:52 -0300)]
titles: Add module description comment
Diogo Franco (Kovensky) [Sun, 14 Jul 2013 17:49:47 +0000 (14:49 -0300)]
anidb: rename SaveCurrentTitles to DumpTitles, convert to function
It's part of the Dump family of functions, and doesn't actually need any
data from an AniDB struct.
Diogo Franco (Kovensky) [Sun, 14 Jul 2013 17:45:22 +0000 (14:45 -0300)]
anidb: Initial attempt at high level AniDB library
Diogo Franco (Kovensky) [Sun, 14 Jul 2013 17:44:47 +0000 (14:44 -0300)]
titles: Check if the anime-titles database was loaded correctly
Diogo Franco (Kovensky) [Sun, 14 Jul 2013 17:44:08 +0000 (14:44 -0300)]
titles: Fix compilation of search_test
Forgotten commit.
Diogo Franco (Kovensky) [Sun, 14 Jul 2013 17:42:17 +0000 (14:42 -0300)]
titles: LoadDB from an io.Reader instead of io.ReadCloser
Diogo Franco (Kovensky) [Sun, 14 Jul 2013 17:41:44 +0000 (14:41 -0300)]
titles: Correctly load anime-titles.dat for testing
Diogo Franco (Kovensky) [Sun, 14 Jul 2013 17:38:24 +0000 (14:38 -0300)]
udpapi: Return pointers to reply structs
Keeps the reply structs convertible to APIReply. Also change the gob
registrations to use the pointer types.
Diogo Franco (Kovensky) [Sun, 14 Jul 2013 17:37:10 +0000 (14:37 -0300)]
udpapi: Don't keep UDP API key in ecbState
Also add test to check if ECB is indeed correctly implemented.
Diogo Franco (Kovensky) [Sun, 14 Jul 2013 17:34:21 +0000 (14:34 -0300)]
udpapi: Handle encryption correctly
Previously, the very first packet to be received after the ENCRYPT call
was not properly decrypted; the getPacket function was using the old
encryption state.
Diogo Franco (Kovensky) [Sun, 14 Jul 2013 17:32:50 +0000 (14:32 -0300)]
udpapi: Avoid out-of-bounds access on malformed packets
Also reports the strconv.ParseInt error if it's not possible to decode
the reply's code.
Diogo Franco (Kovensky) [Sun, 14 Jul 2013 17:30:22 +0000 (14:30 -0300)]
httpapi: Better support for Resources
Diogo Franco (Kovensky) [Sat, 13 Jul 2013 02:22:02 +0000 (23:22 -0300)]
udpapi: Register types with encoding/gob
Diogo Franco (Kovensky) [Sat, 13 Jul 2013 02:12:55 +0000 (23:12 -0300)]
udpapi: Finish(?) partially-done refactor, fixes compilation
I didn't break the API with the previous commit :(
Diogo Franco (Kovensky) [Sat, 13 Jul 2013 02:03:50 +0000 (23:03 -0300)]
udpapi: Server-side timeouts are unrelated to UDP timeouts
Yay, first API breakage.
Diogo Franco (Kovensky) [Sat, 13 Jul 2013 01:57:20 +0000 (22:57 -0300)]
udpapi: escape & as & and \n as <br/>
Diogo Franco (Kovensky) [Sat, 13 Jul 2013 01:56:39 +0000 (22:56 -0300)]
misc: refactor, add tests, add list simplification method
Diogo Franco (Kovensky) [Fri, 12 Jul 2013 15:39:24 +0000 (12:39 -0300)]
misc: New module with common / useful code
Diogo Franco (Kovensky) [Fri, 12 Jul 2013 21:44:59 +0000 (18:44 -0300)]
titles: Specify how the search string is split
Diogo Franco (Kovensky) [Fri, 12 Jul 2013 21:20:00 +0000 (18:20 -0300)]
udp: rename to udpapi, reformat AniDBUDP documentation
Diogo Franco (Kovensky) [Fri, 12 Jul 2013 21:15:44 +0000 (18:15 -0300)]
titles: Document
Diogo Franco (Kovensky) [Fri, 12 Jul 2013 20:22:58 +0000 (17:22 -0300)]
Initial commit
For now, only includes low-level wrappers for AniDB's various APIs. The
current API is in no way frozen and may break at any time.
These are not intended for being used in third party code, but as building
blocks for a unified API library.
The HTTP wrapper does simple encoding/xml wrapping of the anime and categorylist
HTTP API calls. No caching is implemented.
The UDP wrapper does rate control internally and implements the essential
session-keeping API calls, but does no caching.