Get torrent feed for given options
@param array $options array of options available options consist of: query, category, filter, offset and user
@return NyaaTorrent[]
508698
public function getFeed($options = []) {
        $pool = Registry::getStash();

        $cache = $pool->getItem('nyaa/feed/database/'.hash('sha512', json_encode($options)));

        if ($cache->isMiss()) {
            $cache->lock();

            $results = $this->getResults($options);
            $torrents = [];

            foreach ($results as $result) {
                $torrents[] = NyaaTorrent::fromArray($result);
            }

            $cache->set($torrents, 864000);
        }

        $data = $cache->get();

        return $data;
    }
392839
protected function parseOptions(array $options)
    {
        $options = array_merge($this->defaultOptions, $options);

        foreach ($options as $option => $value) {
            if (! in_array($option, $this->allowedOptions, true)) {
                throw new \InvalidArgumentException("Option [$option] is not allowed.");
            }
        }

        return $options;
    }
679679
public function getSubscriberFilterOptions(array $options = array()) {
		$defaults = array(
			'type' => 'user',
			'relationship' => 'subscribed',
			'relationship_guid' => $this->getOriginalContainer()->guid,
			'inverse_relationship' => true,
		);
		return array_merge($defaults, $options);
	}
935273
private function getDefaultHttpClientOptions(array $options = []): array
    {
        $headers = [];

        if ($this->token !== null) {
            $headers['Authorization'] = 'Bearer '.$this->token;
        }

        $languagesInOptions = (array_key_exists('headers', $options) &&
            array_key_exists('Accept-Language', $options['headers']));
        if ($this->languages !== null && $languagesInOptions === false) {
            $headers['Accept-Language'] = join(', ', $this->languages);
        }

        if ($this->version !== null) {
            $headers['Accept'] = 'application/vnd.thetvdb.v'.$this->version;
        }

        $options['http_errors'] = false;

        return array_merge_recursive(['headers' => $headers], $options);
    }
491976
private function getRouteArguments(array $options = [])
    {
        $routeArguments = [];
        foreach ($options as $key => $value) {
            if (array_key_exists($key, $this->options)) {
                $this->options[$key] = $value;
                continue;
            }
            $routeArguments[$key] = $value;
        }
        return $routeArguments;
    }
862485
public function getAlbums(array $options = [])
    {
        $deferred = new Deferred();

        // For some reason, TIDAL returns 404 if the filter isn't caps.
        if (isset($options['filter'])) {
            $options['filter'] = strtoupper($options['filter']);
        }

        $options = Options::buildOptions(
            array_merge(Options::$defaultOptions, ['filter' => 'COMPILATIONS']),
            $options,
            $this->tidal
        );

        $this->http->get(
            Options::replace(Endpoints::ARTIST_ALBUMS, ['id' => $this->id]).$options
        )->then(function ($response) use ($deferred) {
            $albums = new Collection();

            foreach ($response['items'] as $album) {
                $albums->push(new Album(
                    $this->http,
                    $this->tidal,
                    $album
                ));
            }

            $deferred->resolve($albums);
        }, function ($e) use ($deferred) {
            $deferred->reject($e);
        });

        return $deferred->promise();
    }
612499
public function getList(array $options = array())
    {
        $uri = $this->buildListResourceUri($this->listId);
        $response = $this->makeApiRequest($uri, $options);
        return $response->list;
    }
643052
protected function getConvertOptions(array $options)
    {
        if ($this->arrHas($options, 'convertOptions')) {
            return $this->arrGet($options, 'convertOptions', []);
        }

        return $this->arrGet($options, 'convert_options', []);
    }
656572
protected function parseAttachmentOptions(array $options)
    {
        $defaults = $this->getDefaultAttachmentOptions();

        $options = array_intersect_key($options, $defaults);
        $options = array_filter($options, [ $this, 'filterAttachmentOption' ], ARRAY_FILTER_USE_BOTH);
        $options = array_replace($defaults, $options);

        return $options;
    }
471308
public function getPhotos(array $options = array())
    {

        $uri = $this->buildUserResourceUri('photos');
        $response = $this->makeAuthenticatedApiRequest($uri);

        return $response->photos->items;

    }
503181
public function collectRecursive($query, $options = [])
  {
    $feed = $this->getFeed($query, $options);

    $userIds = [];

    foreach ($feed as $torrent) {
      if (!isset($userIds[$torrent->getSeriesHash()])) {
        $userIds[$torrent->getSeriesHash()] = $torrent->getUserId();
      }
    }

    $userIds = array_unique(array_values($userIds));

    return $this->collectForUser($query, $userIds, $options);
  }
42575
public function getCollection(array $options = array())
    {
        /** @var UserEntity[] $collection */
        $collection = $this->userManager->findUsers();
        $resource   = new Resource($this->generateBrowseUrl(), array('count' => count($collection)));

        foreach ($collection as $element) {
            $resource->setEmbedded('user', $this->createResourceFromUser($element));
        }

        return $resource;
    }
560227
protected function getOptions()
    {
        foreach ($options = parent::getOptions() as $option) {
            if ($option[0] === 'seeder') {
                $option[4] = config('tenancy.db.tenant-seed-class', null);
            }
        }

        return array_merge($options, [
            $this->addWebsiteOption()
        ]);
    }
283741
public function resources($options = [])
    {
        $url = $this->getBaseUrl();
        $resources = $this->request($url, $options);

        return $resources;
    }
566791
protected function parseOptions(array $options)
    {
        $request = $this->requestStack->getCurrentRequest();
        if (!empty($request) && $request->isSecure()) {
            $options['recommenderEndPoint'] = str_replace('http://', 'https://', $options['recommenderEndPoint']);
        }

        return $options;
    }
953926
private function generateQueryOptions(array $options = [])
    {
        if (isset($options['query'])) {
            $result = $options['query'] + $this->getDefaultOptions();
        } else {
            $result['query'] = $options + $this->getDefaultOptions();
        }

        return $result;
    }
70758
protected function getOptions(array  $options) : array
    {
        $options['format'] = Arr::get($options, 'format', $this->format);
        $options['locale'] = Arr::get($options, 'locale', config('app.locale'));

        return $options;
    }