Fixed autoplaylist repeat to fill show
This commit is contained in:
parent
8bd93e3f6d
commit
8a92c80bcb
2 changed files with 40 additions and 4 deletions
|
@ -31,8 +31,23 @@ class AutoPlaylistManager {
|
|||
$playlistid = $si->GetAutoPlaylistId();
|
||||
Logging::info("Scheduling $playlistid");
|
||||
// call the addPlaylist to show function and don't check for user permission to avoid call to non-existant user object
|
||||
$si->addPlaylistToShow($playlistid, false);
|
||||
while ($si->getPercentScheduled() < 100) {
|
||||
$sid = $si->getShowId();
|
||||
$playlistrepeat = new Application_Model_Show($sid);
|
||||
|
||||
if ($playlistrepeat->getAutoPlaylistRepeat()) {
|
||||
$full = false;
|
||||
while(!$full) {
|
||||
$si = new Application_Model_ShowInstance($autoplaylist->getDbId());
|
||||
$si->addPlaylistToShow($playlistid, false);
|
||||
$ps = $si->getPercentScheduled();
|
||||
//Logging::info("The total percent scheduled is % $ps");
|
||||
if ($ps > 100) {
|
||||
$full = true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else {
|
||||
$si->addPlaylistToShow($playlistid, false);
|
||||
}
|
||||
$si->setAutoPlaylistBuilt(true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue