-
-
Notifications
You must be signed in to change notification settings - Fork 219
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
Conversation
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. |
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 edited to add that the update script can be called with |
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() { Were you able to get this working ? |
Only difference I see is in the ApiController.php file This is the version I had
In LibreTime we have it simplified to But perhaps that isn't equivalent. Or perhaps this is completely unrelated. I'm testing right now. |
The simplified version really works with php |
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. |
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. |
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
Perhaps it isn't working because I didn't have anything playing. As the pypo notify.log looks empty. |
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 I'll try and diagnose it further but thought I'd share my results here in case you have some insight. |
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? |
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.
The |
At least the PHP parts seem to work, I'm seeing this in the logs:
If you switched to the autodj branch after installing you may need to rerun |
After realizing that I need to schedule a show in the next hour I got it to work. After 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. |
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. |
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. |
Unfortunately I could not get to work an autoDJ function. The logs show this:
I tried to run it on the local virtual machine thru vagrant as well as on my test VPS. |
I also got
|
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. |
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! |
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." |
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. |
I'll start calling it Auto Playlist as well in that case, sorry if my use of the AutoDJ wording created any confusion. |
@korotkov13 you can ignore the warnings from |
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 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 |
Installed on clean debian jessie on test vps.
|
Can you try running |
Requesting upgrade... after that still the same error after reboot got this
|
For some reason it appears that either the show database ID or possibly the user object is incorrect and thus causing this issue.
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. |
Today morning I found that it is somehow added tracks to the shows I created before sleep. In what time usually tracks adding after create show with autoplaysists? |
Made clean install ubntu 14.04 on OpenVZ VPS
|
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 |
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) I have about 20 items matching each smartblock above, but I got the same two twice, i.e.... Jingle 16 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! :) |
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. |
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. |
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