Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Robbs AutoPlaylist #55

Merged
merged 9 commits into from
Mar 11, 2017
Merged

Robbs AutoPlaylist #55

merged 9 commits into from
Mar 11, 2017

Conversation

hairmare
Copy link
Member

My cherry-pick of Robbs AutoDJ code from the tarball (Robbt/Airtime@05cf4d9)

I did some very slight refactoring to get the DB update code to work properly (and with a 3.0.0-alpha version) and also did some nit-picky whitespace fixes. You can view my changes to the original commit at 32a1a66...radiorabe:feature/autodj.

@Robbt Can you let me know if I caught every part we need?

Fixes #27

@hairmare hairmare changed the title Robbs AutoDJ [WIP] Robbs AutoDJ Mar 10, 2017
@hairmare hairmare changed the title [WIP] Robbs AutoDJ Robbs AutoDJ Mar 10, 2017
@hairmare hairmare added this to the 3.0.0-alpha milestone Mar 10, 2017
@Robbt
Copy link
Member

Robbt commented Mar 10, 2017

I noticed you didn't change the schema.sql to add the autoplaylist column. Is this intentional ? Are we relying upon an update script and versioning to include add it ? I tried to install on top of a previous install and ran into a database error but then reran from scratch and it appears to work.

@hairmare
Copy link
Member Author

hairmare commented Mar 10, 2017

Thas was most likely what I missed because I didn't look at Robbt/Airtime@e2779df closely enough.

I added them in 095ddae by hacking airtime_mvc/build/schema.xml and running ../../vendor/bin/propel-gen from the airtime_mvc/build directory.

edited to add that the update script can be called with python utils/upgrade.py if needed.

@Robbt
Copy link
Member

Robbt commented Mar 11, 2017

I've been testing this but for some reason it doesn't appear that the AutoPlaylistTask is being ran. I see nothing in my logs to indicate AutoPlaylistManager::hasAutoPlaylistPollIntervalPassed is running properly. At the very least I should be seeing the results from this. public static function hasAutoPlaylistPollIntervalPassed() {
Logging::info("Checking autoplaylist poll");

Were you able to get this working ?

@Robbt
Copy link
Member

Robbt commented Mar 11, 2017

Only difference I see is in the ApiController.php file

This is the version I had

/**
 * Manually trigger the TaskManager task to poll for completed Celery tasks
 */
public function pollCeleryAction() {
    $taskManager = TaskManager::getInstance();
    $clazz = version_compare(phpversion(), '5.5.0', '<') ? get_class(new CeleryTask) : CeleryTask::class;
    $taskManager->runTask($clazz);
}

In LibreTime we have it simplified to
/**
* Manually trigger the TaskManager task to poll for completed Celery tasks
*/
public function pollCeleryAction() {
$taskManager = TaskManager::getInstance();
$taskManager->runTask('CeleryTask');
}

But perhaps that isn't equivalent. Or perhaps this is completely unrelated. I'm testing right now.

@hairmare
Copy link
Member Author

The simplified version really works with php <5.5.

@Robbt
Copy link
Member

Robbt commented Mar 11, 2017

Well was the AutoPlaylist functionality working when you tested it ? I'm trying again in a fresh vagrant box to see if I have better luck.

@Robbt
Copy link
Member

Robbt commented Mar 11, 2017

I'm currently testing to see if the TaskManager::runTask is getting called by determining if it will automatically update and download new podcasts. I'm suspicious that this is the cause, but I'm not even sure what triggers TaskManager to run it's tasks on a regular basis at this point anyways.

@Robbt
Copy link
Member

Robbt commented Mar 11, 2017

I don't think the task manager runTasks function is getting triggered. I figured out how it is supposed to get called. It is via airtime_mvc/application/controllers/plugins/PageLayoutInitPlugin.php

    // Piggyback the TaskManager onto API calls. This provides guaranteed consistency
        // (there is at least one API call made from pypo to Airtime every 7 minutes) and
        // greatly reduces the chances of lock contention on cc_pref while the TaskManager runs
        if ($controller == "api") {
            $taskManager->runTasks();
        }
    }
}

Perhaps it isn't working because I didn't have anything playing. As the pypo notify.log looks empty.

@Robbt
Copy link
Member

Robbt commented Mar 11, 2017

Ok I did a little more testing. I don't think the replacement is_a is working for _isTask. This is what tells TaskManager to add a task to the loop for runTasks.

I put back in the reflection code in TaskManager and it appeared to see the various tasks based upon the logging I did.

But then I ran into this error with AutoPlayList code
Class 'AutoPlaylistManager' not found at /vagrant/airtime_mvc/application/common/TaskManager.php:245
array (
'type' => 1,
'message' => 'Class 'AutoPlaylistManager' not found',
'file' => '/vagrant/airtime_mvc/application/common/TaskManager.php',
'line' => 245,
)

I'll try and diagnose it further but thought I'd share my results here in case you have some insight.

@hairmare
Copy link
Member Author

The API also get called pretty often when you use the web interface. I'll do some serious testing on this as soon as I'm back on ubuntu. It should work when I just to create a simple playlist and assign that or do I need to add smart blocks?

@Robbt
Copy link
Member

Robbt commented Mar 11, 2017

A simple playlist should suffice for testing purposes. It just needs to be in a show at some point (can't remember what I set it too) in the future to be scheduled. The interface is a little rough and could probably be refined in terms of how it's communicated to the user etc. (ie it still shows red unscheduled !).

The is_a fix from 09aea8b was not quite the way to go, with array_key_exists and class_implements implements the TaskManager finds all tasks again.
@hairmare
Copy link
Member Author

The is_a() change did indeed introduce a bug. I fixed it in 1c1f758. I'll try to figure out why it isn't playing next.

@hairmare
Copy link
Member Author

At least the PHP parts seem to work, I'm seeing this in the logs:

2017-03-11T21:52:14+00:00 INFO (6): localhost Checking autoplaylist poll
2017-03-11T21:52:14+00:00 INFO (6): localhost Checking to run Auto Playlist

If you switched to the autodj branch after installing you may need to rerun composer install to generate new autoloader classmaps. Cleaning up the autoloader to be psr-something compatible is a task I dread.

@hairmare
Copy link
Member Author

After realizing that I need to schedule a show in the next hour I got it to work. After Checking to run Auto Playlist the log said Scheduling 1 and my show got populated with tracks.

The red mark disappeared as soon as I looked at the show using the "View" context menu. A way to visually recognize autodj shows before they are populated would be nice though.

@Robbt
Copy link
Member

Robbt commented Mar 11, 2017

Great work. This looks ready to ship. Next I'm going to work on porting my smart block improvements from my 2.5.x branch that I never got around to grabbing.

@Robbt Robbt merged commit 2be8ef0 into libretime:master Mar 11, 2017
@hairmare hairmare deleted the feature/autodj branch March 11, 2017 23:47
@hairmare
Copy link
Member Author

I'm finalizing debian and centos installs and will get on to releasing 3.0.0-alpha as soon as the pyssl thing is merged.

@korotkov13
Copy link

korotkov13 commented Mar 16, 2017

Unfortunately I could not get to work an autoDJ function.
I made a playlist (tried with mp3s and with smart blocks inside) Make a new scheduled show with enabled Auto Schedule Playlist - choose new playlist, and it creates empty show.

The logs show this:

2017-03-16T21:34:08+03:00 ERR (3): radio.host [ApiController.php:34 - init()] - Session already started for an API request. Check your code because
this will negatively impact performance.
2017-03-16T21:34:39+03:00 INFO (6): radio.host Checking autoplaylist poll
2017-03-16T21:35:27+03:00 INFO (6): radio.host Array
(
[url] => radio.host
[action] => showbuilder/schedule-add
[params] => Array
(
[media_items] => Array
(
[0] => Array
(
[id] => 3
[type] => playlist
)

            )

        [scheduled_items] => Array
            (
                [0] => Array
                    (
                        [id] => 0
                        [instance] => 3
                        [timestamp] => 0
                    )

            )

    )

)

2017-03-16T21:35:28+03:00 INFO (6): radio.host Checking autoplaylist poll
2017-03-16T21:35:28+03:00 INFO (6): radio.host Checking to run Auto Playlist
2017-03-16T21:35:28+03:00 ERR (3): radio.host [ApiController.php:34 - init()] - Session already started for an API request. Check your code because
this will negatively impact performance.
2017-03-16T21:35:38+03:00 INFO (6): radio.host Array
(
[url] => radio.host
[action] => schedule/cancel-current-show
[params] => Array
(
[instance id] => 3
)

)

2017-03-16T21:35:58+03:00 INFO (6): radio.host Array
(
[url] => radio.host
[action] => schedule/add-show
[params] => Array
(
[form_data] => Array
(
[add_show_id] => -1
[add_show_instance_id] => -1
[add_show_name] => New Show
[add_show_url] =>
[add_show_genre] =>
[add_show_description] =>
[add_show_has_autoplaylist] => 1
[add_show_autoplaylist_id] => 3
[add_show_start_now] => future
[add_show_start_date] => 2017-03-16
[add_show_start_time] => 18:40
[add_show_end_date_no_repeat] => 2017-03-16
[add_show_end_time] => 20:00
[add_show_duration] => 01h 20m
[add_show_timezone] => UTC
[add_show_repeats] => 0
[add_show_linked] => 0
[add_show_repeat_type] => 0
[add_show_monthly_repeat_type] => 2
[add_show_end_date] => 2017-03-16
[add_show_no_end] => 1
[cb_airtime_auth] => 1
[cb_custom_auth] => 0
[custom_username] =>
[custom_password] =>
[show_source_host] =>
[show_source_port] =>
[show_source_mount] =>
[add_show_record] => 0
[add_show_rebroadcast] => 0
[add_show_rebroadcast_date_absolute_1] =>
[add_show_rebroadcast_time_absolute_1] =>
[add_show_rebroadcast_date_absolute_2] =>
[add_show_rebroadcast_time_absolute_2] =>
[add_show_rebroadcast_date_absolute_3] =>
[add_show_rebroadcast_time_absolute_3] =>
[add_show_rebroadcast_date_absolute_4] =>
[add_show_rebroadcast_time_absolute_4] =>
[add_show_rebroadcast_date_absolute_5] =>
[add_show_rebroadcast_time_absolute_5] =>
[add_show_rebroadcast_date_absolute_6] =>
[add_show_rebroadcast_time_absolute_6] =>
[add_show_rebroadcast_date_absolute_7] =>
[add_show_rebroadcast_time_absolute_7] =>
[add_show_rebroadcast_date_absolute_8] =>
[add_show_rebroadcast_time_absolute_8] =>
[add_show_rebroadcast_date_absolute_9] =>
[add_show_rebroadcast_time_absolute_9] =>
[add_show_rebroadcast_date_absolute_10] =>
[add_show_rebroadcast_time_absolute_10] =>
[add_show_rebroadcast_date_1] =>
[add_show_rebroadcast_time_1] =>
[add_show_rebroadcast_date_2] =>
[add_show_rebroadcast_time_2] =>
[add_show_rebroadcast_date_3] =>
[add_show_rebroadcast_time_3] =>
[add_show_rebroadcast_date_4] =>
[add_show_rebroadcast_time_4] =>
[add_show_rebroadcast_date_5] =>
[add_show_rebroadcast_time_5] =>
[add_show_rebroadcast_date_6] =>
[add_show_rebroadcast_time_6] =>
[add_show_rebroadcast_date_7] =>
[add_show_rebroadcast_time_7] =>
[add_show_rebroadcast_date_8] =>
[add_show_rebroadcast_time_8] =>
[add_show_rebroadcast_date_9] =>
[add_show_rebroadcast_time_9] =>
[add_show_rebroadcast_date_10] =>
[add_show_rebroadcast_time_10] =>
[add_show_hosts_autocomplete] =>
[add_show_background_color] =>
[add_show_color] =>
[csrf] => f9c984d3dcbfc3edfdb9ecc8c48d44e2b2e60fca
[start_date_disabled] => false
[start_time_disabled] => false
[add_show_hosts] =>
[add_show_day_check] =>
)

    )

)

2017-03-16T21:35:59+03:00 INFO (6): radio.host Checking autoplaylist poll
2017-03-16T21:36:39+03:00 INFO (6): radio.host Checking autoplaylist poll
2017-03-16T21:36:40+03:00 INFO (6): radio.host Checking to run Auto Playlist
2017-03-16T21:36:40+03:00 INFO (6): radio.host Scheduling 3
2017-03-16T21:36:40+03:00 ERR (3): radio.host [ApiController.php:34 - init()] - Session already started for an API request. Check your code because this will negatively impact performance.

I tried to run it on the local virtual machine thru vagrant as well as on my test VPS.

@korotkov13
Copy link

I also got

Package guzzle/guzzle is abandoned, you should avoid using it. Use guzzlehttp/guzzle instead.
Package videlalvaro/php-amqplib is abandoned, you should avoid using it. Use php-amqplib/php-amqplib instead.
Package raven/raven is abandoned, you should avoid using it. Use sentry/sentry instead.
when typing composer install

@Robbt
Copy link
Member

Robbt commented Mar 16, 2017

Ok, so the way it is coded now the autoplaylist functionality doesn't schedule the show until an hour before the show is supposed to run. This is so that it can be updated with the latest tracks etc.

Also if you happen to schedule any tracks it will just add the tracks it schedules at the end of whatever you already scheduled for that spot.

I'm open to suggestions for how we can tweak the UI to have it make sense and be easy to use.

@geftactics
Copy link

I didn't have any joy when I tried to use it last night, but I've just seen the comment above that says you need to schedule a show for within the next hour... I will have a play again when I get chance.

If the above is the case then we should try and add a help tip next the the auto DJ setting that explains this - I might even try and do a change if I can figure it out!

@geftactics
Copy link

Robbt, maybe a help tip next to the auto do option that has the following hover text?

"The 'Auto DJ' playlist selected here will be used 1hr before the show is due to start. It will add content until shows schedule is full."

@Robbt
Copy link
Member

Robbt commented Mar 16, 2017

It doesn't add content until the show schedule is full unless you have a smart block inside the playlist to do this. This is what makes it different from a standard AutoDJ. I wanted a functionality that gave more control to the producer to add a number of different smart blocks together to make their show.

For instance you could have a station ID block followed by the latest of some podcast track, followed by random filler. But it would be up to the creator of the playlist to produce the filler content.

I think it might be worth coding some kind of smart block that would automatically adjust it's time limit to fit the remainder of a show without over filling and thus cutting off tracks.

But to be clear the current Auto Playlist doesn't do that exactly, which is why I didn't call it AutoDJ.

@hairmare
Copy link
Member Author

I'll start calling it Auto Playlist as well in that case, sorry if my use of the AutoDJ wording created any confusion.

@hairmare hairmare changed the title Robbs AutoDJ Robbs AutoPlaylist Mar 16, 2017
@hairmare
Copy link
Member Author

@korotkov13 you can ignore the warnings from composer install for now. It will most likely take a while to fix it and I do not believe the issues are critical at the moment.

@geftactics
Copy link

Ah, I think I get you now... would be nice to maybe have a checkbox option to enable repeat of the auto playlist, then you could do the following with the contents of it...

Smartblock - 1 random ident
Smartblock - 3 songs of certain criteria
Smartblock - 1 random advert

Then it would magically completely fill my shows with indents, music and adverts :)

I guess this would break functionality that smartblocks where they prevent repeat songs

@korotkov13
Copy link

korotkov13 commented Mar 16, 2017

Installed on clean debian jessie on test vps.
AutoPlaylist is not working.
Got this in logs cycling:

2017-03-17T01:27:25+03:00 INFO (6): radio.host Checking autoplaylist poll
2017-03-17T01:27:25+03:00 INFO (6): radio.host Checking to run Auto Playlist
2017-03-17T01:27:25+03:00 INFO (6): radio.host Scheduling 1
2017-03-17T01:27:25+03:00 ERR (3): radio.host [Logging.php:166 - loggingShutdownCallback()] - Call to a member function canSchedule() on null at /usr/share/airtime/php/airtime_mvc/application/models/Scheduler.php:142
array (
  'type' => 1,
  'message' => 'Call to a member function canSchedule() on null',
  'file' => '/usr/share/airtime/php/airtime_mvc/application/models/Scheduler.php',
  'line' => 142,
)
2017-03-17T01:29:25+03:00 INFO (6): radio.host Checking autoplaylist poll
2017-03-17T01:29:25+03:00 INFO (6): radio.host Checking to run Auto Playlist
2017-03-17T01:29:25+03:00 INFO (6): radio.host Scheduling 1
2017-03-17T01:29:26+03:00 ERR (3): radio.host [Logging.php:166 - loggingShutdownCallback()] - Call to a member function canSchedule() on null at /usr/share/airtime/php/airtime_mvc/application/models/Scheduler.php:142
array (
  'type' => 1,
  'message' => 'Call to a member function canSchedule() on null',
  'file' => '/usr/share/airtime/php/airtime_mvc/application/models/Scheduler.php',
  'line' => 142,
)

@hairmare
Copy link
Member Author

Can you try running python utils/upgrade.py maybe the database was not properly updated for some reason.

@korotkov13
Copy link

korotkov13 commented Mar 16, 2017

Requesting upgrade...
No upgrade was performed. The current schema version is 3.0.0-alpha.

after that still the same error

after reboot got this

Registered Component: pypo@212.24.108.165
2017-03-17T01:43:21+03:00 ERR (3): radio [Logging.php:166 - loggingShutdownCallback()] - Call to a member function canSchedule() on null at /usr/share/airtime/php/airtime_mvc/application/models/Scheduler.php:142
array (
  'type' => 1,
  'message' => 'Call to a member function canSchedule() on null',
  'file' => '/usr/share/airtime/php/airtime_mvc/application/models/Scheduler.php',
  'line' => 142,
)

@Robbt
Copy link
Member

Robbt commented Mar 17, 2017

For some reason it appears that either the show database ID or possibly the user object is incorrect and thus causing this issue.

if ($this->checkUserPermissions && $this->user->canSchedule($show->getDbId()) === false) {
                 throw new Exception(sprintf(_("You are not allowed to schedule show %s."), $show->getDbName()));

I'll try it on a fresh debian install and see if I can recreate the error. I guess the only other useful thing is seetng if the database is missing columns or has weird data in it.

@korotkov13
Copy link

Today morning I found that it is somehow added tracks to the shows I created before sleep.
I created one more an hour ago, and it is empty right now.

In what time usually tracks adding after create show with autoplaysists?

@korotkov13
Copy link

korotkov13 commented Mar 17, 2017

Made clean install ubntu 14.04 on OpenVZ VPS
Installation of RabbitMQ finished without issues only after updating the latest version of erlang and only from here
After uploading tracks and making playlist, tried to create show with AutoPlaylist, but had nothing.
no errors figured in log.
After restart found these errors.

> 2017-03-17T14:31:07+03:00 INFO (6): radio.mydomain.radio Registered Component: pypo@externalIP
> 2017-03-17T14:31:08+03:00 INFO (6): radio.mydomain.radio Registered Component: show-recorder@externalIP
> 2017-03-17T14:31:08+03:00 INFO (6): radio.mydomain.radio Notifying RabbitMQ to send message to pypo
> 2017-03-17T14:31:08+03:00 ERR (3): radio.mydomain.radio [ErrorController.php:26 - errorAction()] - stream_socket_client(): unable to connect to tcp://127.0.0.1:5672 (Connection refused)
> 2017-03-17T14:31:08+03:00 ERR (3): radio.mydomain.radio [ErrorController.php:27 - errorAction()] - #0 [internal function]: PhpAmqpLib\Wire\IO\StreamIO->error_handler(2, 'stream_socket_c...', '/usr/share/airt...', 122, Array)
> #1 /usr/share/airtime/php/vendor/videlalvaro/php-amqplib/PhpAmqpLib/Wire/IO/StreamIO.php(122): stream_socket_client('tcp://127.0.0.1...', 111, 'Connection refu...', 3, 4, Resource id #15)
> #2 /usr/share/airtime/php/vendor/videlalvaro/php-amqplib/PhpAmqpLib/Connection/AbstractConnection.php(195): PhpAmqpLib\Wire\IO\StreamIO->connect()
> #3 /usr/share/airtime/php/vendor/videlalvaro/php-amqplib/PhpAmqpLib/Connection/AbstractConnection.php(179): PhpAmqpLib\Connection\AbstractConnection->connect()
> #4 /usr/share/airtime/php/vendor/videlalvaro/php-amqplib/PhpAmqpLib/Connection/AMQPStreamConnection.php(41): PhpAmqpLib\Connection\AbstractConnection->__construct('airtime', 'airtime', '/airtime', false, 'AMQPLAIN', NULL, 'en_US', Object(PhpAmqpLib\Wire\IO\StreamIO), 0)
> #5 /usr/share/airtime/php/airtime_mvc/application/models/RabbitMq.php(23): PhpAmqpLib\Connection\AMQPStreamConnection->__construct('127.0.0.1', '5672', 'airtime', 'airtime', '/airtime')
> #6 /usr/share/airtime/php/airtime_mvc/application/models/RabbitMq.php(50): Application_Model_RabbitMq::sendMessage('airtime-pypo', 'direct', true, '{"event_type":"...')
> #7 /usr/share/airtime/php/airtime_mvc/application/controllers/ApiController.php(1091): Application_Model_RabbitMq::SendMessageToPypo('reset_liquidsoa...', Array)
> #8 /usr/share/airtime/php/vendor/zendframework/zendframework1/library/Zend/Controller/Action.php(516): ApiController->rabbitmqDoPushAction()
> #9 /usr/share/airtime/php/vendor/zendframework/zendframework1/library/Zend/Controller/Dispatcher/Standard.php(308): Zend_Controller_Action->dispatch('rabbitmqDoPushA...')
> #10 /usr/share/airtime/php/vendor/zendframework/zendframework1/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
> #11 /usr/share/airtime/php/vendor/zendframework/zendframework1/library/Zend/Application/Bootstrap/Bootstrap.php(105): Zend_Controller_Front->dispatch()
> #12 /usr/share/airtime/php/vendor/zendframework/zendframework1/library/Zend/Application.php(384): Zend_Application_Bootstrap_Bootstrap->run()
> #13 /usr/share/airtime/php/airtime_mvc/application/airtime-boot.php(84): Zend_Application->run()
> #14 /usr/share/airtime/php/airtime_mvc/public/index.php(68): require_once('/usr/share/airt...')
> #15 {main}
> 2017-03-17T14:31:08+03:00 ERR (3): radio.mydomain.radio [ErrorController.php:54 - errorAction()] - An internal application error has occurred.: exception 'ErrorException' with message 'stream_socket_client(): unable to connect to tcp://127.0.0.1:5672 (Connection refused)' in /usr/share/airtime/php/vendor/videlalvaro/php-amqplib/PhpAmqpLib/Wire/IO/StreamIO.php:122
> Stack trace:
> #0 [internal function]: PhpAmqpLib\Wire\IO\StreamIO->error_handler(2, 'stream_socket_c...', '/usr/share/airt...', 122, Array)
> #1 /usr/share/airtime/php/vendor/videlalvaro/php-amqplib/PhpAmqpLib/Wire/IO/StreamIO.php(122): stream_socket_client('tcp://127.0.0.1...', 111, 'Connection refu...', 3, 4, Resource id #15)
> #2 /usr/share/airtime/php/vendor/videlalvaro/php-amqplib/PhpAmqpLib/Connection/AbstractConnection.php(195): PhpAmqpLib\Wire\IO\StreamIO->connect()
> #3 /usr/share/airtime/php/vendor/videlalvaro/php-amqplib/PhpAmqpLib/Connection/AbstractConnection.php(179): PhpAmqpLib\Connection\AbstractConnection->connect()
> #4 /usr/share/airtime/php/vendor/videlalvaro/php-amqplib/PhpAmqpLib/Connection/AMQPStreamConnection.php(41): PhpAmqpLib\Connection\AbstractConnection->__construct('airtime', 'airtime', '/airtime', false, 'AMQPLAIN', NULL, 'en_US', Object(PhpAmqpLib\Wire\IO\StreamIO), 0)
> #5 /usr/share/airtime/php/airtime_mvc/application/models/RabbitMq.php(23): PhpAmqpLib\Connection\AMQPStreamConnection->__construct('127.0.0.1', '5672', 'airtime', 'airtime', '/airtime')
> #6 /usr/share/airtime/php/airtime_mvc/application/models/RabbitMq.php(50): Application_Model_RabbitMq::sendMessage('airtime-pypo', 'direct', true, '{"event_type":"...')
> #7 /usr/share/airtime/php/airtime_mvc/application/controllers/ApiController.php(1091): Application_Model_RabbitMq::SendMessageToPypo('reset_liquidsoa...', Array)
> #8 /usr/share/airtime/php/vendor/zendframework/zendframework1/library/Zend/Controller/Action.php(516): ApiController->rabbitmqDoPushAction()
> #9 /usr/share/airtime/php/vendor/zendframework/zendframework1/library/Zend/Controller/Dispatcher/Standard.php(308): Zend_Controller_Action->dispatch('rabbitmqDoPushA...')
> #10 /usr/share/airtime/php/vendor/zendframework/zendframework1/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
> #11 /usr/share/airtime/php/vendor/zendframework/zendframework1/library/Zend/Application/Bootstrap/Bootstrap.php(105): Zend_Controller_Front->dispatch()
> #12 /usr/share/airtime/php/vendor/zendframework/zendframework1/library/Zend/Application.php(384): Zend_Application_Bootstrap_Bootstrap->run()
> #13 /usr/share/airtime/php/airtime_mvc/application/airtime-boot.php(84): Zend_Application->run()
> #14 /usr/share/airtime/php/airtime_mvc/public/index.php(68): require_once('/usr/share/airt...')

@hairmare
Copy link
Member Author

What errors are leading you to installing the erlang-solutions RabbitMQ? Does the provided package fail? Does your VPN have ipv6, older RabbitMQ might need special configuration to work on an ipv4 only stack.

There might be some slight compatibility changes in python-kombu that we need to adjust to in api_clients for this to to work with newer RabbitMQ versions.

@geftactics
Copy link

I just had another play with this on a fresh vagrant box... Seemed to work ok to a point...

I scheduled a show to start in 15 mins from now, enabled auto playlist, then made a few other shows for the following hours. By the time I went to look at the first one, it had populated content as expected! woop!

My only problem is this...

My auto playlist contained the following:

Smartblock: 'One random jingle' (dynamic, random order, limit 1 item, length<15sec)
Smartblock: 'One random mix' (dynamic, random order, limit 1 item, length>30mins)
Smartblock: 'One random jingle' (dynamic, random order, limit 1 item, length<15sec)
Smartblock: 'One random mix' (dynamic, random order, limit 1 item, length>30mins)

I have about 20 items matching each smartblock above, but I got the same two twice, i.e....

Jingle 16
Mix 4
Jingle 16
Mix 4

Not sure exactly how it works, but is the dynamic smartblock 'regenerated' each time it is called/used?

Let me know if there is any debug info I can provide, or if this expected behaviour!

:)

@Robbt
Copy link
Member

Robbt commented Mar 19, 2017

The dynamic smart block should be random each time it is called. The randomness is provided by the database, but you may have found a bug in that it only generates the dynamic smartblock once per auto playlist, ie. it creates the dynamic smartblock randomly once but then the second time it calls it it has already been defined. I'll need to test this and see how easy it is to fix if it is reproducible. I'd try a couple of other shows and see if they always do the same thing and if they produce the same jingle list or just two different repeating mix/jingles each time. It could of happened by chance due to the relatively small number of tracks to select from.

Thanks for testing.

@geftactics
Copy link

Ignore my comment above - It must have been a coincidence!!

I've made more AutoPlaylist driven shows, and it isn't picking the same every time.

@lock
Copy link

lock bot commented Oct 20, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please chat to us on discourse or ask for help on our chat if you have any questions or need further assistance with this issue.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Problem: AutoDJ feature is the most often requested feature
4 participants