mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 01:08:56 +00:00
Update API and RSS classes
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
2018-02-14 DariusIII
|
||||
* Chg: Update API and RSS classes
|
||||
* Chg: Remove unused Settings use statement from api page
|
||||
* Fix: Fix moviesSearch $whereSql query
|
||||
2018-02-13 DariusIII
|
||||
|
||||
+3
-3
@@ -56,7 +56,7 @@ class API extends Capabilities
|
||||
* Add language from media info XML to release search names (Used by API).
|
||||
* @param array $releases
|
||||
*/
|
||||
public function addLanguage(&$releases)
|
||||
public function addLanguage(&$releases): void
|
||||
{
|
||||
if ($releases && \count($releases)) {
|
||||
foreach ($releases as $key => $release) {
|
||||
@@ -162,7 +162,7 @@ class API extends Capabilities
|
||||
* Check if a parameter is empty.
|
||||
* @param string $parameter
|
||||
*/
|
||||
public function verifyEmptyParameter($parameter)
|
||||
public function verifyEmptyParameter($parameter): void
|
||||
{
|
||||
if (isset($this->getRequest[$parameter]) && $this->getRequest[$parameter] === '') {
|
||||
Utility::showApiError(201, 'Incorrect parameter ('.$parameter.' must not be empty)');
|
||||
@@ -173,7 +173,7 @@ class API extends Capabilities
|
||||
* @param $releases
|
||||
* @param callable $getCoverURL
|
||||
*/
|
||||
public function addCoverURL(&$releases, callable $getCoverURL)
|
||||
public function addCoverURL(&$releases, callable $getCoverURL): void
|
||||
{
|
||||
if ($releases && \count($releases)) {
|
||||
foreach ($releases as $key => $release) {
|
||||
|
||||
+3
-3
@@ -51,7 +51,7 @@ class RSS extends Capabilities
|
||||
|
||||
$catLimit = 'AND r.categories_id BETWEEN '.Category::TV_ROOT.' AND '.Category::TV_OTHER;
|
||||
|
||||
if (count($cat)) {
|
||||
if (\count($cat)) {
|
||||
if ((int) $cat[0] === -2) {
|
||||
$cartSearch = sprintf(
|
||||
'INNER JOIN users_releases ON users_releases.users_id = %d AND users_releases.releases_id = r.id',
|
||||
@@ -153,7 +153,7 @@ class RSS extends Capabilities
|
||||
),
|
||||
'videos_id'
|
||||
),
|
||||
(count($excludedCats) ? 'AND r.categories_id NOT IN ('.implode(',', $excludedCats).')' : ''),
|
||||
(\count($excludedCats) ? 'AND r.categories_id NOT IN ('.implode(',', $excludedCats).')' : ''),
|
||||
($airDate > -1 ? sprintf('AND tve.firstaired >= DATE_SUB(CURDATE(), INTERVAL %d DAY) ', $airDate) : ''),
|
||||
NZB::NZB_ADDED,
|
||||
Category::TV_ROOT,
|
||||
@@ -208,7 +208,7 @@ class RSS extends Capabilities
|
||||
),
|
||||
'imdbid'
|
||||
),
|
||||
(count($excludedCats) ? ' AND r.categories_id NOT IN ('.implode(',', $excludedCats).')' : ''),
|
||||
(\count($excludedCats) ? ' AND r.categories_id NOT IN ('.implode(',', $excludedCats).')' : ''),
|
||||
NZB::NZB_ADDED,
|
||||
Category::MOVIE_ROOT,
|
||||
Category::MOVIE_OTHER,
|
||||
|
||||
Reference in New Issue
Block a user