Rename search functions to be more descriptive (ie. searchByImdbId searches for movies even without imdbid, so renamed to moviesSearch)

This commit is contained in:
DariusIII
2018-02-13 15:17:14 +01:00
parent 218c8bf67d
commit d7556bfe4d
5 changed files with 8 additions and 7 deletions
+1
View File
@@ -1,4 +1,5 @@
2018-02-13 DariusIII
* Chg: Rename search functions to be more descriptive (ie. searchByImdbId searches for movies even without imdbid, so renamed to moviesSearch)
* Chg: Use insertGetId again in addGroup function
* Chg: Update phpunit to version 7.0.1
2018-02-12 DariusIII
+3 -3
View File
@@ -776,7 +776,7 @@ class Releases
*
* @return array
*/
public function searchShows(
public function tvSearch(
array $siteIdArr = [],
$series = '',
$episode = '',
@@ -922,7 +922,7 @@ class Releases
*
* @return array
*/
public function searchbyAnidbId($aniDbID, $offset = 0, $limit = 100, $name = '', array $cat = [-1], $maxAge = -1): array
public function animeSearch($aniDbID, $offset = 0, $limit = 100, $name = '', array $cat = [-1], $maxAge = -1): array
{
$whereSql = sprintf(
'%s
@@ -991,7 +991,7 @@ class Releases
*
* @return array
*/
public function searchbyImdbId($imDbId, $offset = 0, $limit = 100, $name = '', array $cat = [-1], $maxAge = -1, $minSize = 0): array
public function moviesSearch($imDbId, $offset = 0, $limit = 100, $name = '', array $cat = [-1], $maxAge = -1, $minSize = 0): array
{
$whereSql = sprintf(
'%s
+1 -1
View File
@@ -15,7 +15,7 @@ $aniDB = new AniDB(['Settings' => $page->settings]);
if (isset($_GET['id']) && ctype_digit($_GET['id'])) {
// force the category to TV_ANIME as it should be for anime, as $catarray was NULL and we know the category for sure for anime
$aniDbReleases = $releases->searchbyAnidbId($_GET['id'], 0, 1000, '', [Category::TV_ANIME], -1);
$aniDbReleases = $releases->animeSearch($_GET['id'], 0, 1000, '', [Category::TV_ANIME], -1);
$aniDbInfo = $aniDB->getAnimeInfo($_GET['id']);
if (! $releases && ! $aniDbInfo) {
+2 -2
View File
@@ -179,7 +179,7 @@ switch ($function) {
$airdate = str_replace('/', '-', $year[0].'-'.$episode);
}
$relData = $releases->searchShows(
$relData = $releases->tvSearch(
$siteIdArr,
$series,
$episode,
@@ -205,7 +205,7 @@ switch ($function) {
$imdbId = ($_GET['imdbid'] ?? -1);
$relData = $releases->searchbyImdbId(
$relData = $releases->moviesSearch(
$imdbId,
$offset,
$api->limit(),
+1 -1
View File
@@ -20,7 +20,7 @@ if (isset($_GET['id']) && ctype_digit($_GET['id'])) {
$catarray = [];
$catarray[] = $category;
$rel = $releases->searchShows(['id' => $_GET['id']], '', '', '', 0, 1000, '', $catarray, -1);
$rel = $releases->tvSearch(['id' => $_GET['id']], '', '', '', 0, 1000, '', $catarray, -1);
$show = Video::getByVideoID($_GET['id']);
if (! $show) {