Skip to Content
It is currently July 21st, 2019, 5:43 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 12 posts ] 
Author Message
PostPosted: June 17th, 2018, 12:10 pm 
Offline
Junior User
Junior User

Joined: August 10th, 2007, 12:11 pm
Posts: 64
Location: Kansas City, MO
Hello,

After doing some extensive searching, I have not found anything like this so far, so I'm willing to pay someone to create this PAL script for me:

I wish to scan a specific folder on my hard drive for new audio files and automatically add them to a specific category in SAM Broadcaster.

In our case, we occasionally attend music conferences where we conduct interviews then upload them to Google Drive, which is then automatically downloaded to a folder on our Automation system. In the past, we have used the "Add Directory" function inside the Clockwheel logic, however, by default, new files are added with category "S" which then displays the files as requestable on our website.

What we would like to do with this script is scan the upload folder for NEW files, then add those new files to the "Interviews" category (which aren't displayed in the request system).

Anyone want to take a crack at this?

_________________
John Dutton, Operations Director
KC Cafe Radio
http://www.kccaferadio.com


Top
 Profile  
Reply with quote  
PostPosted: June 17th, 2018, 7:26 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7863
Location: Aachen (Germany)
Honestly I'm not sure if you really want to hire someone for such a simple task:
Code:
CAT['Interviews'].Clear;
CAT['Interviews'].AddDir('C:\Downloaded Interviews');

Doesn't that already solve your problem?

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

We're offering custom PAL / PHP code and general SAM assistance at palscripts.com

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: June 17th, 2018, 11:23 pm 
Offline
Junior User
Junior User

Joined: August 10th, 2007, 12:11 pm
Posts: 64
Location: Kansas City, MO
So a simple 2-line PAL script is it, eh?

Set it up to execute once per hour to import what's there and run it via the event scheduler.

How this needs to work for us is that new files are automatically uploaded to the folder as they are recorded at the remote site.... However, existing recordings would remain in the folder until manually deleted.

So my next question would be, would this procedure only import the NEW files, or would they re-import everything (including files imported on the previous run), and potentially repeat those recordings in playback.

In other words, we would want to ensure that as interviews are aired, they are not selected to air additional times.

_________________
John Dutton, Operations Director
KC Cafe Radio
http://www.kccaferadio.com


Top
 Profile  
Reply with quote  
PostPosted: June 18th, 2018, 2:24 am 
Offline
SVS Member
SVS Member

Joined: October 15th, 2003, 11:59 pm
Posts: 4728
Location: Los Angeles - A Little West Of Nashville
You can use this is if you have your Interviews BOTH in the category and also on disk. This is because the PAL will delete all in the category and re-create it.

If not, take out the line:
Code:
CAT['Interviews'].Clear;
and manually remove duplicates through SAM.
Code:
SUBDIR['c:\Interviews'].Rescan;
CAT['Interviews'].Clear;

// To NOT use sub-directories, use:  CAT['Interviews'].AddDir('C:\Interviews', false, ipBottom);
// To use sub-directories, use: CAT['Interviews'].AddDir('C:\Interviews', true, ipBottom);

CAT['Interviews'].AddDir('C:\Interviews', true, ipBottom);

_________________
- DJ Dee
- Spacial Volunteer Support (SVS)
- Custom PAL services: www.palscripts.com
- http://www.AlternativeHD.com
- http://www.lahotcountry.com


Top
 Profile  
Reply with quote  
PostPosted: June 18th, 2018, 1:22 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7863
Location: Aachen (Germany)
Scenario:
Interviews 1-5 are added on the first day and are aired that day, but stay in the folder.
Interviews 6-10 are added the next weekend to the same folder.
Now the folder contains ten tracks of which only five are new.
You only want to play the new ones,.

Right so far?
if you are OK with keeping the tracks in sam somewhere even if they are never to be played again, this is feasible, but requires more than my suggested 2-liner or the third line added by cwdj.
With some SQL magic checking the date_added field and only playing or moving to the play category those tracks that were added on this day and moving all older ones to some kind of archive category.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

We're offering custom PAL / PHP code and general SAM assistance at palscripts.com

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: June 18th, 2018, 3:11 pm 
Offline
Junior User
Junior User

Joined: August 10th, 2007, 12:11 pm
Posts: 64
Location: Kansas City, MO
Mastacheata wrote:
Scenario:
Interviews 1-5 are added on the first day and are aired that day, but stay in the folder.
Interviews 6-10 are added the next weekend to the same folder.
Now the folder contains ten tracks of which only five are new.
You only want to play the new ones,.

Right so far?


This is very close, but with a little bit more frequency. Let's say interview 1 is recorded and uploaded, then an hour later interviews 2 and 3 are uploaded, then two hours later interview 4 is uploaded. Basically, as interview opportunities come along, we record then upload them over the course of, say a 3-day festival.

In the past I have remoted into SAM to manually import files to the "Interviews" category as they are uploaded, setting them to "Play once, then delete the file" to keep them from repeating. Then once per hour the clockwheel would play one of the interviews from the category.

In this new scenario I'm proposing, SAM would check the folder, say, once per hour just ahead of the time an interview is scheduled to air and import any new files found there into the Interview category. In place of the "play once and delete" option, we could just use the "enforce rules" option when the clockwheel picks from the category, as our track-repeat-rule is set out to 8 hours. An interview repeating in a different daypart wouldn't be too bad, really, and I could go in and manually remove files at the end of each day's coverage if I had to.

My main concern is that with a blanket "add directory to category" command that files added on the previous run would be added again on the second run and increase the potential of a repeat of the same material from hour to hour.

_________________
John Dutton, Operations Director
KC Cafe Radio
http://www.kccaferadio.com


Top
 Profile  
Reply with quote  
PostPosted: June 19th, 2018, 3:30 am 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7863
Location: Aachen (Germany)
kccafe wrote:
My main concern is that with a blanket "add directory to category" command that files added on the previous run would be added again on the second run and increase the potential of a repeat of the same material from hour to hour.

If your repeat rules catch that case, you should be fine.
Duplicate tracks are just multiple references in the categorylist to the very same songlist entry (aka the same track in terms of repeat rules).

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

We're offering custom PAL / PHP code and general SAM assistance at palscripts.com

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: June 19th, 2018, 8:36 am 
Offline
Junior User
Junior User

Joined: August 10th, 2007, 12:11 pm
Posts: 64
Location: Kansas City, MO
So if I understand correctly, SAM wouldn't create a new database entry for the same track that already exist in the category from previous runs.

So, instead of a PAL script, could the above commands just be put into an "add files to queue" scheduled event and set to run once hourly?:

Code:
Dir['C:\Interviews'].Rescan;
CAT['Interviews'].AddDir('C:\Interviews', false, ipBottom);
Cat['Interviews'].QueueBottom(smLRP, EnforceRules);

_________________
John Dutton, Operations Director
KC Cafe Radio
http://www.kccaferadio.com


Top
 Profile  
Reply with quote  
PostPosted: June 19th, 2018, 3:09 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7863
Location: Aachen (Germany)
Not sure if that's what you wanted. This one adds one interview to the queue every hour if one is available that fits your repeat rules.
Also it will make quite a mess out of your Interviews category (will not affect selection, but display and at some point when you have more than 100 tracks in your interview category, general performance.) Better add the CAT['Interviews'].Clear; command in front as well.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

We're offering custom PAL / PHP code and general SAM assistance at palscripts.com

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: June 19th, 2018, 4:18 pm 
Offline
Junior User
Junior User

Joined: August 10th, 2007, 12:11 pm
Posts: 64
Location: Kansas City, MO
Yes, adding one interview per hour to the queue (if there is one that fits the repeat rules) would work for our purposes. If no new interviews were uploaded over the previous hour and there is nothing that fits the repeat rule, then the event would be skipped for that hour.

So, using the "CAT["Interviews'].Clear;" command up-front would remove tracks from the category, but not the database, so that when a previously imported interview is re-imported on the new run, it would not be at risk of being repeated before the expiration of the track repeat rule. Correct?

_________________
John Dutton, Operations Director
KC Cafe Radio
http://www.kccaferadio.com


Top
 Profile  
Reply with quote  
PostPosted: June 19th, 2018, 6:54 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7863
Location: Aachen (Germany)
Correct.
Clearing a category will not remove the actual tracks from the database.
That can only be done by deleting one track after the other or by directly working on the database instead of using the PAL helper functions.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

We're offering custom PAL / PHP code and general SAM assistance at palscripts.com

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: June 19th, 2018, 10:12 pm 
Offline
Junior User
Junior User

Joined: August 10th, 2007, 12:11 pm
Posts: 64
Location: Kansas City, MO
So, in conclusion, I would create an "Add files to Queue" Scheduled event with the following:
Code:
CAT["Interviews'].Clear;
Dir['C:\Interviews'].Rescan;
CAT['Interviews'].AddDir('C:\Interviews', false, ipBottom);
Cat['Interviews'].QueueBottom(smLRP, EnforceRules);

Schedule it to occur once hourly and we should be good-to-go!

Thank you, Benedikt for my first "advanced" lesson in scripting! And thank you also, "Dj Dee" for your contribution. Someday, when I have more time on my hands I really should go through the Spacial tutorials on PAL scripting and see what other kind of trouble I can cause! :)

_________________
John Dutton, Operations Director
KC Cafe Radio
http://www.kccaferadio.com


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: Exabot [Bot] and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group