Commit 78f731c4 authored by Marcelo Rivera's avatar Marcelo Rivera

(feat): load groups and added MIN_COUNT

1 merge request!281WIP: (feat): Minds Pro
Pipeline #73206682 passed with stages
in 9 minutes and 30 seconds
......@@ -16,6 +16,8 @@ use Minds\Interfaces;
class channel implements Interfaces\Api
{
const MIN_COUNT = 6;
public function get($pages)
{
/** @var User $currentUser */
......@@ -55,6 +57,10 @@ class channel implements Interfaces\Api
case 'blogs':
$type = 'object:blog';
break;
case 'groups':
$type = 'group';
$container_guid = null;
break;
}
//
......@@ -122,7 +128,7 @@ class channel implements Interfaces\Api
'limit' => $limit,
'type' => $type,
'algorithm' => 'top',
'period' => '1y',
'period' => '7d',
'sync' => $sync,
'from_timestamp' => $fromTimestamp,
'query' => $query,
......@@ -138,7 +144,7 @@ class channel implements Interfaces\Api
try {
$result = $this->getData($entities, $opts, $asActivities, $sync);
if ($result->count() === 0) {
if ($result->count() <= static::MIN_COUNT) {
$opts['algorithm'] = 'latest';
$result = $this->getData($entities, $opts, $asActivities, $sync);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment