mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 09:49:28 +02:00
This commit is contained in:
parent
39c8c0ea06
commit
5bcf87ea81
5 changed files with 44 additions and 19 deletions
|
@ -661,9 +661,8 @@ class Category
|
|||
|
||||
$timeLogName = TimeLogStart($cacheSuffix);
|
||||
$cacheHandler = new CategoryCacheHandler(0);
|
||||
$result = $cacheHandler->getCache($cacheSuffix, 0);
|
||||
TimeLogEnd($timeLogName, __LINE__);
|
||||
if (empty($result)) {
|
||||
if (!$cacheHandler->hasCache($cacheSuffix, 0)) {
|
||||
$videos = self::getTotalVideosFromCategory($categories_id, $showUnlisted, $getAllVideos, $renew);
|
||||
TimeLogEnd($timeLogName, __LINE__);
|
||||
$lives = self::getTotalLivesFromCategory($categories_id, $showUnlisted, $renew);
|
||||
|
@ -675,6 +674,7 @@ class Category
|
|||
$cacheHandler->setCache($result);
|
||||
TimeLogEnd($timeLogName, __LINE__);
|
||||
} else {
|
||||
$result = $cacheHandler->getCache($cacheSuffix, 0);
|
||||
$result = object_to_array($result);
|
||||
}
|
||||
TimeLogEnd($timeLogName, __LINE__);
|
||||
|
@ -771,7 +771,7 @@ class Category
|
|||
$total = $cacheHandler->getCache($suffix);
|
||||
TimeLogEnd($timeLogName, __LINE__);
|
||||
|
||||
if ($renew || empty($total)) {
|
||||
if ($renew || (empty($total) && $total !== 0 && $total !== '0')) {
|
||||
$sql = "SELECT count(id) as total FROM videos v WHERE 1=1 AND categories_id = ? ";
|
||||
|
||||
if (User::isLogged()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue