public function getItems() { $stash = Registry::getStash(); $cache = $stash->getItem('nyaa/feed/series/' . str_replace('/', '~', $this->seriesHash) . '/' . $this->query); if ($cache->isMiss() || true) { $cache->lock(); $nyaaCollector = Registry::getNyaaCollector(); $mappedByHash = $nyaaCollector->collect($this->query); $torrents = []; if (isset($mappedByHash[$this->seriesHash])) { $torrents = $mappedByHash[$this->seriesHash]->getTorrents(); } $cache->set($torrents, 864000); } return $cache->get(); }
public static function getById($id) { $db = Registry::getDatabase(); $feed = $db->builder()->select()->from('feed')->where('id = :id', [':id' => $id])->queryRow(); return Feed::createFromArray($feed); }