Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SUP-20392:make syndication feed with dynamic playlist work the same as playlist executeFromFilter #9149

Merged
merged 10 commits into from Feb 9, 2020

Conversation

@ravitshalem
Copy link
Contributor

ravitshalem commented Feb 3, 2020

No description provided.


if ($this->dynamicPlaylist)
{
return $this->getEntriesCountFromDynamic();

This comment has been minimized.

Copy link
@MosheMaorKaltura

MosheMaorKaltura Feb 3, 2020

Contributor

Only this code should be executed if there is a filter

{
list($mediaEntryFilterForPlaylist, $playlistService) = self::prepareParameters($entryFilter);
$entriesFromFilter = $this->getEntriesFromPlaylist($playlistService, $mediaEntryFilterForPlaylist);
$kalturaEntries = array_merge($kalturaEntries, $entriesFromFilter->toArray());

This comment has been minimized.

Copy link
@MosheMaorKaltura

MosheMaorKaltura Feb 3, 2020

Contributor

Keep only the Id's
Use associative array to have the uniq,

return count($kalturaEntries);
}

protected static function getEntryListUnique($kalturaEntries)

This comment has been minimized.

Copy link
@MosheMaorKaltura

MosheMaorKaltura Feb 3, 2020

Contributor

remove

$this->lastEntryCreatedAt = 0;
}

++$this->returnedEntriesCount;

This comment has been minimized.

Copy link
@MosheMaorKaltura

MosheMaorKaltura Feb 3, 2020

Contributor

$this->returnedEntriesCount++;

$this->fetchNextEntriesAccordingToFilter();
}

if (current($this->entriesCurrentPage))

This comment has been minimized.

Copy link
@MosheMaorKaltura

MosheMaorKaltura Feb 3, 2020

Contributor

put current into local var
validate local var against !== false;

if (current($this->entriesCurrentPage))
{
$entry = entryPeer::retrieveByPK(current($this->entriesCurrentPage)->id);
if($entry && !array_key_exists($entry->getId(), $this->entryIdsHandled))

This comment has been minimized.

Copy link
@MosheMaorKaltura

MosheMaorKaltura Feb 3, 2020

Contributor

Check what happen in the current implementation when using multi filters and they return the same object twice.
In any case the return should be false only when no more entries

$pager = new KalturaPager();
$pager->pageSize = $this->syndicationFeed->pageSize;
}
if (!$currentFilter)

This comment has been minimized.

Copy link
@MosheMaorKaltura

MosheMaorKaltura Feb 3, 2020

Contributor

Move up , immediate after getting the value.

@@ -15,6 +15,8 @@ class KalturaSyndicationFeedRenderer
const CACHE_EXPIRY = 2592000; // 30 days

const PAGE_SIZE_MAX_VALUE = 500;

const TOTAL_RESULTS = 200;

This comment has been minimized.

Copy link
@MosheMaorKaltura

MosheMaorKaltura Feb 3, 2020

Contributor

Rename to - DYNAMIC_PLAYLIST_TOTAL...

$entriesFromFilter = $this->getEntriesFromPlaylist($playlistService, $mediaEntryFilterForPlaylist);
foreach ($entriesFromFilter as $entry)
{
if (!array_key_exists($entry->id,$kalturaEntries))

This comment has been minimized.

Copy link
@MosheMaorKaltura

MosheMaorKaltura Feb 5, 2020

Contributor

remove the if

$currentEntry = current($this->entriesCurrentPage);
while ($currentEntry !== false)
{
$entry = entryPeer::retrieveByPK(current($this->entriesCurrentPage)->id);

This comment has been minimized.

Copy link
@MosheMaorKaltura

MosheMaorKaltura Feb 5, 2020

Contributor

Use currentEntry

@ravitshalem ravitshalem merged commit 16da998 into Orion-15.17.0 Feb 9, 2020
@ravitshalem ravitshalem deleted the Orion-15.16.0-SUP-20392 branch Feb 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.