Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Issue #2977314 by IT-Cru: Every time creating thumb media image on video update #58

Open
wants to merge 3 commits into
base: 8.x-2.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Controller/OmniaController.php
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,13 @@ protected function mapData(MediaInterface $media) {
$entityType = $this->entityTypeManager()->getDefinition('media');
$videoField = $this->videoFieldName();

// Prepare nexxVideoData from JSON send by NEXX and
// try to get existing thumbnail URL from existing video
// to fix re-adding thumb media image on every update push.
$this->prepareData();
if (!$media->$videoField->isEmpty()) {
$this->nexxVideoData['thumb'] = $media->$videoField->thumb;
}
$media->set($videoField, $this->nexxVideoData);

$actor_ids = explode(',', $this->nexxVideoData['actors_ids']);
Expand Down