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

Provide a __toString for StationMedia and disable persist cascading.

This commit is contained in:
Buster "Silver Eagle" Neece 2019-09-06 19:24:42 -05:00
parent 513d04f7d2
commit 9b2721aba7
No known key found for this signature in database
GPG Key ID: 6D9E12FF03411F4E
2 changed files with 10 additions and 3 deletions

View File

@ -201,7 +201,7 @@ class StationMedia
protected $cue_out;
/**
* @ORM\OneToMany(targetEntity="StationPlaylistMedia", mappedBy="media", cascade={"persist"})
* @ORM\OneToMany(targetEntity="StationPlaylistMedia", mappedBy="media")
*
* @DeepNormalize(true)
* @Serializer\MaxDepth(1)
@ -213,7 +213,7 @@ class StationMedia
protected $playlists;
/**
* @ORM\OneToMany(targetEntity="StationMediaCustomField", mappedBy="media", cascade={"persist"})
* @ORM\OneToMany(targetEntity="StationMediaCustomField", mappedBy="media")
*
* @var Collection
*/
@ -723,6 +723,14 @@ class StationMedia
return $this->playlists;
}
/**
* @return string A string identifying this entity.
*/
public function __toString(): string
{
return $this->unique_id.': '.$this->artist.' - '.$this->title;
}
/**
* Retrieve the API version of the object/array.
*

View File

@ -238,7 +238,6 @@ class Media extends AbstractTask
}
}
$this->_flushAndClearRecords();
$fs->flushAllCaches(true);
$this->logger->debug(sprintf('Media processed for station "%s".', $station->getName()), $stats);