AutoDj Script Using ( PHP) - 2.1.5.6 Solution You were waiting On- No Ls_Script modification need
  • I found this script amongst the old dev tools 

    • you can test it by running php /path to script/auto_schedule_show.php
    • it does everything update  database and  everything

    I need help in converting it to a model so the community can use it to patch all 2,5,1. with auto dj

    converting it to a class too will do if you not familiar with Zend

    I ca provide all the forms etc

    PLEASE USE THE AUTO_ROTATION  SCRIPT .THERE ARE TWO .ONE HAS ONLY 10 SONGS THE OTHER HAVE 1000 . CHANGE THESE AS SUITED. bOTH ARE THE SAME CODE   I CANNOT DELETE THE ORIGINAL

    THIS SCRIPT CAN BE USES BY YOUR OWN TRIGGER
    1. PYTHON
    2. PHP
    3. LIQUIDSOAP

    THIS SCRIPT DO NOT NEED CRON ,YOU NEED SOMEWAY TO TELL IT THAT NOTHING IS SCHEDULE SO RUN THE SCRIPT.

    IT WILL SCHEDULE IN THE NEXT AVAILABLE SCHEDULE SLOT INSTEAD OF HAVING TO BE PROGRAM TWO HOURS BEFORE AS THE NEW SCRIPTS

    IT SHOULD

    • WORK ON ANY TIMEZONE AS I HAVE FIXED THAT
    • QUEUE AT NEXT AVAILABLE TIME SCHEDULE
    • PREVENTS MULTIPLE PLAY AT THE SAME TIME PERIOD
    THE METHOD I WILL USE IS LIQUIDSOAP. HOPE THE INTELLEGENT "NUMSCOME" WHO CHOSE TO MARKDOWN WILL PROVIDE A SOLUTION EVEN A TRIGGER COMMAND AT WHEN NOTHING IS SCHEDULE

    ENJOY


    Post edited by Voisses Tech at 2017-04-09 11:04:21
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • 8 Comments sorted by
  • Fount out that the way I calculate the start is only applicable  to people who makes limited uses the Airtime Ui.So I have redone the  calculation and now

    •  Now update the show days  in the Db
    • calculate the option if there is no first show,and when the re is a blank space between show
    • Autodj are now only filled for  the time period now to the end of the day,that is a new autodj schedule based on day 1,2,3, 4.......7

    I am working on the zend framework (PHP) now and it will include  all features of the rotation in pro plus ablitty to create the playlist in the  UI,


    Peace OUT

    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • I will post the  solutions ,maybe tomorrow
    Post edited by Voisses Tech at 2017-04-09 11:05:29
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • I am submitting this so that the PHP Geeks can carry it forward.

    This Script will

    • Create a show called Rotation
    • It will pick music files at random and place them in the queue have 20 ,you can change it read the script  (I fixed this from the original script)
    • This will search only for files currently  in the database not files you have deleted or remove(I fixed this from the original script)
    • It will schedule a show within 30 seconds of your last show (I fixed this from the original script)
    • it will update history and all other Airtime data

    • It was what is need for a simple rotation (hidden Gem)
    1280 x 1024 - 156K
    Post edited by Voisses Tech at 2017-03-31 19:06:27
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
    • rename the text file to php
    • run as php  /parh-to-script/auto_schedule_show.php

      

    thats it .

    I will write a script to check when there is silence and let it  trigger this script

    • bug ,if the default silence is trigger you have to delete the first file in now playing or the currently playing

    Let me know if you find none net week I will see how to fix


    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • There is a - -clean option  good to  clear duplicate shows and current schedules and show
    you can test it by running
     
     php /path to script/auto_schedule_show.php --clean
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • This Script is for the brave at heart.

    When I tested the Rotations on the two available option ,I notice at times you have dual audio
    1. one for schedule and
    2. one for the Rotation
    This is what I tested and it might work.I do not have enough hours of  to make it definitive so its Alpha,if you are a php guru tell me your feedback part so I can move this into the zendframework

    • Basically it checks the schedules directory and if there are files it will not run preventing duplicate queue and schedules
    • If the directory is empty it starts to queue(run)
    • Do a cronjob for every minute and your system should at all times have something
    • also put in your local script(/usr/local/bin/ or /opt/bin) may be best.Optional
    • Remember if this rotation has already filled a spot and you want th use the spot.just cancel the show
    • Remember the clean option also its like a clean slate but it does not remove the entries from your database
     DO NOT USE THIS THE QUEUE NEVER REALLY EMPTY. ITS JUST A CONCEPT. I WILL COME UP WITH AN INTERFACE AND HAVE THIS RUN  WHEN THE NOTIFICATION SCRIPT TELLS THAT THE SOURCE IS EMPTY(PYTHON) OR NOTHING IS SCHEDULE (DASHBOARD.JS)

    I will look for a better error handling to check the directory, but I do hope  others will make it better.
    Post edited by Voisses Tech at 2017-03-31 19:05:57
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • Good news
    1. I think I solve the problem with the two or more songs playing at the same time. Quickfix if you hear two songs playing just  go to the schedule in the calendar and look at the times you will see that you have overlapping times just delete one of the show.This occur because there is no check against the database to prevent overlapping time. I have a code now running and its almost perfect
    2. Still feel added Liquidsoap features could bolster the  stability of airtime. If you use this  https://forum.sourcefabric.org/discussion/18348/something-to-consider-if-you-use-the-rotation-script  you will have a nice feel of the autodj script and it updates
    3. I will try to mimic the Rotation UI that airtime have submitted and present it as an addon.i may add this feature,where the system will randomly select the amount of songs you tell it to ,schelule it and play it out for you.
    4. The I will move it to an hack
    5. Hope the person selecting the negatives will be surprise that this thread is in the support section seeking opinions but its being perfect .I have taught so many class to see mr.negative enter and while all the other students passed , Mr.negative is still searching for Answers
    This script is a Gold


    Post edited by Voisses Tech at 2017-04-09 11:06:03
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • You can trigger this by any method you like
    • No need to schedule rotation 2 - 3 hours before as being offered now
    • Remove and refill as you like

    make sure your script is located at /usr/local/bin/

    1.     You can just run the command  php /usr/local/bin/airtime_rotation.php
    2.    You can search the framework and just use an if statement to say if nothing is schedule run getopt of this script
    3.     use python
    4.     I use liquidsoap since it has its own built in slient detector .You donot have to use it

    at about line 320

    put this

    def rotation_trigger()
       command= "php /usr/local/bin/airtime_rotation.php"
       log(label="Rotation Created",level=5,command)
        system(command)      
     
    end

    station_id=single(id="s_stationId","/srv/backup/files/station_id/station_id.mp3")
    #or uses
    # s=mksafe(s)
                     
    s  =fallback(id="radio",
                track_sensitive=false,
                         transitions=[transition,transition,transition],
                         [strip_blank(id="main_silence",max_blank=240.,threshold=-70.,default),
                         on_blank(rotation_trigger, strip_blank(id="url_silence",max_blank=120.,threshold=-70.,s)),
                          station_id])
    Post edited by Voisses Tech at 2017-04-09 11:36:06
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.