my unscheduled audio wasn't being deleted, I believe file_delete needs a filename string not a file object.

I am sorta wondering, why not run the rip script with the normal cron, and only archive in the first place if there's a scheduled show.

CommentFileSizeAuthor
#2 recorder.php.txt4.44 KBmfb
file_delete.patch.txt886 bytesmfb

Comments

drewish’s picture

Status: Needs review » Fixed

good catch on the file_delete. not sure what your other comments ment.

the ripper.php script should be run by normal cron... or did you mean run under drupal's cron? there's a couple of problems with that:
* it ties up an apache child for an hour waiting while streamripper runs.
* you end up adding extra logic to check that you only start the rip on the correct cron run, i.e. some random person didn't hit your cron.php page or you scheduled it to run twice an hour.
* you might start late if you get called after a long search re-indexing.
* it's less flexible. the current setup and can be run on a different machine and you could add a little code to copy the files over to your drupal website for importing.

mfb’s picture

StatusFileSize
new4.44 KB

fair enough.

Btw, with regards to tied up apache process, what I've done in the past is send output to /dev/null so the apache process can stop.

I've attached an example for an on-demand streamripper

(perhaps something like this even has a place in the station module..)

drewish’s picture

i'll take a look at that when i get a chance. i've got some ideas for big change to the ripper script. it all kind of ties into reworking of the schedule to remove the one hour block structure. make it more of a start at this minute ends at this minute kind of thing. for the admin end i'm thinking everything will be rounded into 15 minute increments.

the idea is the archive downloads the week's schedule and writes it to a schedule.ini file. the file consists of a list of start times for shows and their durration (and maybe a program id in there). you schedule the ripper to run every 15 minutes so when it starts it checks if there's a program starting at the current time, and if so how long should it record for.

mfb’s picture

Cool.
seems like archive could store the schedule in database rather than writing to a schedule.ini file

drewish’s picture

true but my aim is to minimize the requirements for the ripper script. the ini file is simple enough it can be edited by hand or generated by another program.

drewish’s picture

let's move this discussion over to this thread.

Anonymous’s picture

Status: Fixed » Closed (fixed)