4
0
mirror of https://github.com/AzuraCast/AzuraCast.git synced 2024-06-17 22:47:04 +00:00

Log the registered track for AutoDJ debugging.

This commit is contained in:
Buster "Silver Eagle" Neece 2020-03-08 14:35:19 -05:00
parent 6dc2526d54
commit 04756a0f87
No known key found for this signature in database
GPG Key ID: 6D9E12FF03411F4E
5 changed files with 29 additions and 5 deletions

View File

@ -221,6 +221,14 @@ class Song
return $this->history;
}
/**
* @return string A string identifying this entity.
*/
public function __toString(): string
{
return 'Song ' . $this->id . ': ' . $this->artist . ' - ' . $this->title;
}
/**
* Retrieve the API version of the object/array.
*

View File

@ -325,7 +325,7 @@ class SongHistory
if (null === $cued || 0 === $cued) {
$this->setTimestampCued(time());
}
$this->sent_to_autodj = true;
}
@ -559,4 +559,11 @@ class SongHistory
return $response;
}
public function __toString()
{
return (null !== $this->media)
? (string)$this->media
: (string)$this->song;
}
}

View File

@ -3,8 +3,8 @@ namespace App\Entity;
use App\Annotations\AuditLog;
use App\ApiUtilities;
use App\Radio\Backend\Liquidsoap;
use App\Normalizer\Annotation\DeepNormalize;
use App\Radio\Backend\Liquidsoap;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
@ -795,7 +795,7 @@ class StationMedia
*/
public function __toString(): string
{
return $this->unique_id . ': ' . $this->artist . ' - ' . $this->title;
return 'StationMedia ' . $this->unique_id . ': ' . $this->artist . ' - ' . $this->title;
}
/**

View File

@ -8,7 +8,7 @@ class GetNextSong extends Event
{
/** @var null|string|Entity\SongHistory The next song, if it's already calculated. */
protected $next_song;
protected Entity\Station $station;
public function __construct(Entity\Station $station)
@ -56,4 +56,11 @@ class GetNextSong extends Event
{
return $this->station;
}
public function __toString()
{
return (null !== $this->next_song)
? (string)$this->next_song
: 'No Song';
}
}

View File

@ -321,7 +321,9 @@ class AutoDJ implements EventSubscriberInterface
if ($event->setNextSong($this->playSongFromPlaylist($playlist, $cued_song_history,
$preferredMode))) {
$this->logger->info('Playable track found and registered.');
$this->logger->info('Playable track found and registered.', [
'next_song' => (string)$event,
]);
return;
}
}