mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2025-01-25 22:24:28 +00:00
cache magnet public status on user public only
This commit is contained in:
parent
d9cbc6af73
commit
e871662d87
@ -217,7 +217,7 @@ try
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Cache public status
|
// Cache public status
|
||||||
$public['user'][$user->userId] = $user->public;
|
$public['user'][$user->userId] = (bool) $user->public;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Dump users feed
|
/// Dump users feed
|
||||||
@ -359,7 +359,12 @@ try
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Cache public status
|
// Cache public status
|
||||||
$public['magnet'][$magnet->magnetId] = $magnet->public;
|
if (!empty($public['user'][$magnet->userId]))
|
||||||
|
{
|
||||||
|
$public['magnet'][$magnet->magnetId] = (bool) $magnet->public;
|
||||||
|
} else {
|
||||||
|
$public['magnet'][$magnet->magnetId] = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Dump magnets feed
|
/// Dump magnets feed
|
||||||
@ -378,8 +383,8 @@ try
|
|||||||
foreach ($db->getMagnetDownloads() as $magnetDownload)
|
foreach ($db->getMagnetDownloads() as $magnetDownload)
|
||||||
{
|
{
|
||||||
// Dump public data only
|
// Dump public data only
|
||||||
if (isset($public['magnet'][$magnetDownload->magnetId]) && $public['magnet'][$magnetDownload->magnetId] === '1' &&
|
if (!empty($public['magnet'][$magnetDownload->magnetId]) &&
|
||||||
isset($public['user'][$magnetDownload->userId]) && $public['user'][$magnetDownload->userId] === '1')
|
!empty($public['user'][$magnetDownload->userId]))
|
||||||
{
|
{
|
||||||
$magnetDownloads[] = (object)
|
$magnetDownloads[] = (object)
|
||||||
[
|
[
|
||||||
@ -407,8 +412,8 @@ try
|
|||||||
foreach ($db->getMagnetComments() as $magnetComment)
|
foreach ($db->getMagnetComments() as $magnetComment)
|
||||||
{
|
{
|
||||||
// Dump public data only
|
// Dump public data only
|
||||||
if (isset($public['magnet'][$magnetComment->magnetId]) && $public['magnet'][$magnetComment->magnetId] === '1' &&
|
if (!empty($public['magnet'][$magnetComment->magnetId]) &&
|
||||||
isset($public['user'][$magnetComment->userId]) && $public['user'][$magnetComment->userId] === '1')
|
!empty($public['user'][$magnetComment->userId]))
|
||||||
{
|
{
|
||||||
$magnetComments[] = (object)
|
$magnetComments[] = (object)
|
||||||
[
|
[
|
||||||
@ -439,8 +444,8 @@ try
|
|||||||
foreach ($db->getMagnetStars() as $magnetStar)
|
foreach ($db->getMagnetStars() as $magnetStar)
|
||||||
{
|
{
|
||||||
// Dump public data only
|
// Dump public data only
|
||||||
if (isset($public['magnet'][$magnetStar->magnetId]) && $public['magnet'][$magnetStar->magnetId] === '1' &&
|
if (!empty($public['magnet'][$magnetStar->magnetId]) &&
|
||||||
isset($public['user'][$magnetStar->userId]) && $public['user'][$magnetStar->userId] === '1')
|
!empty($public['user'][$magnetStar->userId]))
|
||||||
{
|
{
|
||||||
$magnetStars[] = (object)
|
$magnetStars[] = (object)
|
||||||
[
|
[
|
||||||
@ -469,8 +474,8 @@ try
|
|||||||
foreach ($db->getMagnetViews() as $magnetView)
|
foreach ($db->getMagnetViews() as $magnetView)
|
||||||
{
|
{
|
||||||
// Dump public data only
|
// Dump public data only
|
||||||
if (isset($public['magnet'][$magnetView->magnetId]) && $public['magnet'][$magnetView->magnetId] === '1' &&
|
if (!empty($public['magnet'][$magnetView->magnetId]) &&
|
||||||
isset($public['user'][$magnetView->userId] ) && $public['user'][$magnetView->userId] === '1')
|
!empty($public['user'][$magnetView->userId]))
|
||||||
{
|
{
|
||||||
$magnetViews[] = (object)
|
$magnetViews[] = (object)
|
||||||
[
|
[
|
||||||
|
Loading…
x
Reference in New Issue
Block a user