Fix issues relating to how jingles process in song history.
This commit is contained in:
parent
6a30481626
commit
23ddccd49c
|
@ -114,6 +114,7 @@ final class SongHistoryRepository extends AbstractStationBasedRepository
|
||||||
$this->em->persist($previousCurrentSong);
|
$this->em->persist($previousCurrentSong);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$newCurrentSong->setListenersFromLastSong($previousCurrentSong);
|
||||||
$newCurrentSong->setTimestampStart(time());
|
$newCurrentSong->setTimestampStart(time());
|
||||||
$newCurrentSong->updateVisibility();
|
$newCurrentSong->updateVisibility();
|
||||||
|
|
||||||
|
|
|
@ -275,6 +275,19 @@ class SongHistory implements
|
||||||
$this->delta_points = $delta_points;
|
$this->delta_points = $delta_points;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setListenersFromLastSong(?SongHistory $lastSong): void
|
||||||
|
{
|
||||||
|
if (null === $lastSong) {
|
||||||
|
$this->addDeltaPoint(0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$deltaPoints = (array)$lastSong->getDeltaPoints();
|
||||||
|
$lastDeltaPoint = array_pop($deltaPoints);
|
||||||
|
|
||||||
|
$this->addDeltaPoint($lastDeltaPoint);
|
||||||
|
}
|
||||||
|
|
||||||
public function getIsVisible(): bool
|
public function getIsVisible(): bool
|
||||||
{
|
{
|
||||||
return $this->is_visible;
|
return $this->is_visible;
|
||||||
|
|
|
@ -146,14 +146,14 @@ final class Annotations implements EventSubscriberInterface
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$event->addAnnotations([
|
||||||
|
'playlist_id' => $playlist->getId(),
|
||||||
|
]);
|
||||||
|
|
||||||
if ($playlist->getIsJingle()) {
|
if ($playlist->getIsJingle()) {
|
||||||
$event->addAnnotations([
|
$event->addAnnotations([
|
||||||
'jingle_mode' => 'true',
|
'jingle_mode' => 'true',
|
||||||
]);
|
]);
|
||||||
} else {
|
|
||||||
$event->addAnnotations([
|
|
||||||
'playlist_id' => $playlist->getId(),
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue