I added some code to /spotweb/lib/page/SpotPage_newznabapi.php which seems to enable âq,season,epâ searches.
Please note, Iâm on a old branch, and the code differs in the current version. It might need some tweaking for the current version.
Basically, itâs a 1-on-1 copy of the available RageID code, but if parameter is âqâ, set tvSearch directly instead of resolving it by RageID, and then follow the rest of the season / ep handling, resulting in a combined search.
Around line 163, before the music search insert
} elseif (($this->_params['t'] == "t" || $this->_params['t'] == "tvsearch") && $this->_params['q'] != "") {
$tvSearch = $this->_params['q'];
$epSearch = '';
if (preg_match('/^[sS][0-9]{1,2}$/', $this->_params['season']) || preg_match('/^[0-9]{1,4}$/', $this->_params['season'])) {
if (strlen($this->_params['season']) < 3) {
$epSearch = (is_numeric($this->_params['season'])) ? 'S' . str_pad($this->_params['season'], 2, "0", STR_PAD_LEFT) : $this->_params['season'];
} else {
$epSearch = $this->_params['season'] . ' ';
} # else
} elseif ($this->_params['season'] != "") {
$this->showApiError(201);
return ;
} # if
if (preg_match('/^[eE][0-9]{1,2}$/', $this->_params['ep']) || preg_match('/^[0-9]{1,2}$/', $this->_params['ep']) || preg_match('/^[0-9]{1,2}\/[0-9]{1,2}$/', $this->_params['ep'])) {
$epSearch .= (is_numeric($this->_params['ep'])) ? 'E' . str_pad($this->_params['ep'], 2, "0", STR_PAD_LEFT) : $this->_params['ep'];
} elseif ($this->_params['ep'] != "") {
$this->showApiError(201);
return ;
}
# The + operator is supported both by PostgreSQL and MySQL's FTS
$search['value'][] = "Titel:=:+\"" . trim($tvSearch) . "\" +" . $epSearch;