diff --git a/src/server/torr/BTServer.go b/src/server/torr/BTServer.go index 67c668f..f984642 100644 --- a/src/server/torr/BTServer.go +++ b/src/server/torr/BTServer.go @@ -183,6 +183,16 @@ func (bt *BTServer) CacheState(hash metainfo.Hash) *state.CacheState { return cacheState } +func (bt *BTServer) GetCache(hash metainfo.Hash) *memcacheV2.Cache { + st := bt.GetTorrent(hash) + if st == nil { + return nil + } + + cacheState := bt.storage.GetCache(hash) + return cacheState.(*memcacheV2.Cache) +} + func (bt *BTServer) WriteState(w io.Writer) { bt.client.WriteStatus(w) }