Re: [RDD] Putting in multiple RDCatch events in Bulk

2021-07-14 Thread Lorne Tyndale
I have to say as a similar feature, I would love to be able to schedule
recordings in rdcatch via a macro.  Currently we can start and stop the
record deck with a macro, but what I'd like to be able to do is every
day just before midnight run a script that will setup the next day's
record schedule in rdcatch.

Here is my use case.  For a community station that I work with, we have
a programme grid on the website.  Currently I have an audio logger that
I wrote years ago that every day just before midnight it pulls the next
day's programme schedule from the website and sets up cron jobs to
record each show into an audio file with the show name, show id, date
and time.  If there are changes to the programme grid, then as long as
it isn't a same-day change, then it'll be automatically picked up.  I
wrote the system years ago in OS/2 Warp using REXX and it just plain
works.

I'd love to replicate the same thing in Rivendell and RDCatch.  I know
with back-end scripting and the start / stop record deck macro I can
achieve a lot of what I want to do, but I'd still be relying on CRON
jobs (or creating a separate log in Rivendell each day which runs for
the entire purpose of calling the rdcatch record / stop record macros)
for the record start/stop.  It would be a lot cleaner if I could just
run a script every day before midnight to send RDCatch the entire record
schedule for the next day, and then just let RDCatch do its thing. 
You'd then be able to pull up rdcatch and see exactly what it is
currently recording with what is coming up next.

Anyways, just some thoughts

Lorne Tyndale



> 
> 
> Is there a way to bulk import a bunch of RDCatch events or have a feature
> in Rivendell in the next release to take a xml like sheet or a .txt file
> and ingest a bunch of RDCatch events and automatically start running based
> off of the day and time set in the file defined based in RDCatch?
> 
> I am programming almost 20 shows weekly which RDCatch can grab but I am not
> liking having to manually setting it up one-by-one since some shows are 2
> to 5 hours long and it's a long process.
> Thanks in advance!
> 
> Ryan___
> Rivendell-dev mailing list
> Rivendell-dev@lists.rivendellaudio.org
> http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev
___
Rivendell-dev mailing list
Rivendell-dev@lists.rivendellaudio.org
http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev


Re: [RDD] Updating scheduler codes via SQL

2021-07-14 Thread Dave B
I totally forgot about the web API. A safer approach indeed!  Thanks!On Jul 14, 2021 12:18 PM, Fred Gleason  wrote:On Jul 14, 2021, at 05:14, Alejandro olivan Alvarez  wrote:I have messed a little with rivendell database, quite successfully, but only for query/read operations ... altering/writing directly the database of such a complex application is for the brave :-)Just to amplify Alejandro’s point: directly modifying the Rivendell database is NOT A SUPPORTED METHOD for making changes in Rivendell! Specifically, the database schema CAN and DOES change between different versions of Rivendell; meaning that the update method that worked perfectly three months ago could end up NUKING YOUR DATABASE next time around.A much better and safer method for making these sorts of site-specific bulk changes is to write a script that uses Rivendell’s WebAPI. See:	http://opsguide.rivendellaudio.org/apis/web_api.pdfThe Web API is a documented, public and above all stable interface; using it will allow you to write scripts that won’t break across different versions of Rivendell.N.B. — If you insist on writing changes directly to the DB, be sure that you have a known good backup of it first. The sanity and gray hair (not to mention job) that you save may be your own.Cheers!|-|| Frederick F. Gleason, Jr. |             Chief Developer             ||                           |             Paravel Systems             ||-||            Beware of Programmers who carry screwdrivers.            ||                                                                     ||                                              -- Leonard Brandwein   ||-|___
Rivendell-dev mailing list
Rivendell-dev@lists.rivendellaudio.org
http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev


Re: [RDD] Send Now-Next MACRO behavior

2021-07-14 Thread Fred Gleason
On Jul 14, 2021, at 13:21, Alejandro olivan Alvarez 
 wrote:
> It's not entirely clear to me the 'machine stop-down completely' (probably 
> still not enough radio/Rivendell jargon in my mind) maybe I'm wrong, but, 
> translating it to me as 'completelly ending the current playback', that would 
> somehow explain the behavior I experienced.
> 

‘Stopped down’ means that the log machine has a log loaded, but the log is not 
currently playing anything. Typically done when ‘live’ or remotely originated 
programming is being aired.

Cheers!


|-|
| Frederick F. Gleason, Jr. | Chief Developer |
|   | Paravel Systems |
|-|
| A room without books is like a body without a soul. |
| |
| -- Cicero   |
|-|___
Rivendell-dev mailing list
Rivendell-dev@lists.rivendellaudio.org
http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev


Re: [RDD] Send Now-Next MACRO behavior

2021-07-14 Thread Alejandro olivan Alvarez


On 7/14/21 6:29 PM, Fred Gleason wrote:
On Jul 13, 2021, at 11:33, Alejandro olivan Alvarez 
> wrote:


A curious case is when I schedule a macro cart in the log that stops 
the log machine and switches to an external audio source, the idea is 
to do a last now update so the resulting Icecast2 stream will 
display something like 'foo - is now live from bar' ... I can see the 
'SN now 1 1X' on the machine, but the pypad never 'catches' the 
update.


The PAD for the current ‘default Now & Next cart’ that the ‘SN’ macro 
sets is emitted only when the referenced log machine stops-down 
completely. It will not override the PAD sent by currently playing 
cart(s).


Hi! thank you so much for your help!

It's not entirely clear to me the 'machine stop-down completely' 
(probably still not enough radio/Rivendell jargon in my mind) maybe I'm 
wrong, but, translating it to me as 'completelly ending the current 
playback', that would somehow explain the behavior I experienced.


With that interpretation, the machine has to be running (well, what I 
think of 'running'.. executing the log... i mean, no PS), so, the SN 
cart that I execute NOW, will be sent to the server after/once the 
current song on the machine ends (and, therefore, it is time to send a 
new metadata to the streaming server).


Adding PS on the MACROs in my tests, seemed to do the trick... Now I 
explain that as those PS gave time to completely end the current song, 
and then update the streaming Server, and then, even issue a PS afterwards.


Best regards



Cheers!


|-|
| Frederick F. Gleason, Jr. |             Chief Developer         |
|                           |             Paravel Systems         |
|-|
|           Beware of Programmers who carry screwdrivers.       |
|         |
|                                             -- Leonard Brandwein   |
|-|


___
Rivendell-dev mailing list
Rivendell-dev@lists.rivendellaudio.org
http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev
___
Rivendell-dev mailing list
Rivendell-dev@lists.rivendellaudio.org
http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev


[RDD] Test 1

2021-07-14 Thread Fred Gleason
Please disregard. This is a test.

___
Rivendell-dev mailing list
Rivendell-dev@lists.rivendellaudio.org
http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev


Re: [RDD] Updating scheduler codes via SQL

2021-07-14 Thread Alejandro olivan Alvarez


On 7/14/21 6:18 PM, Fred Gleason wrote:
On Jul 14, 2021, at 05:14, Alejandro olivan Alvarez 
> wrote:


I have messed a little with rivendell database, quite successfully, 
but only for query/read operations ... altering/writing directly the 
database of such a complex application is for the brave :-)


Just to amplify Alejandro’s point: directly modifying the Rivendell 
database is NOT A SUPPORTED METHOD for making changes in Rivendell! 
Specifically, the database schema CAN and DOES change between 
different versions of Rivendell; meaning that the update method that 
worked perfectly three months ago could end up NUKING YOUR DATABASE 
next time around.


A much better and safer method for making these sorts of site-specific 
bulk changes is to write a script that uses Rivendell’s WebAPI. See:


http://opsguide.rivendellaudio.org/apis/web_api.pdf 



Man, I missed the API completely during all this time ... thank you for 
the remind and the pdf link!




The Web API is a documented, public and above all stable interface; 
using it will allow you to write scripts that won’t break across 
different versions of Rivendell.


N.B. — If you insist on writing changes directly to the DB, be sure 
that you have a known good backup of it first. The sanity and gray 
hair (not to mention job) that you save may be your own.


Cheers!


|-|
| Frederick F. Gleason, Jr. |             Chief Developer         |
|                           |             Paravel Systems         |
|-|
|           Beware of Programmers who carry screwdrivers.       |
|         |
|                                             -- Leonard Brandwein   |
|-|


___
Rivendell-dev mailing list
Rivendell-dev@lists.rivendellaudio.org
http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev
___
Rivendell-dev mailing list
Rivendell-dev@lists.rivendellaudio.org
http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev


Re: [RDD] Send Now-Next MACRO behavior

2021-07-14 Thread Fred Gleason
On Jul 13, 2021, at 11:33, Alejandro olivan Alvarez 
 wrote:

> A curious case is when I schedule a macro cart in the log that stops the log 
> machine and switches to an external audio source, the idea is to do a last 
> now update so the resulting Icecast2 stream will display something like 
> 'foo - is now live from bar' ... I can see the 'SN now 1 1X' on the 
> machine, but the pypad never 'catches' the update.

The PAD for the current ‘default Now & Next cart’ that the ‘SN’ macro sets is 
emitted only when the referenced log machine stops-down completely. It will not 
override the PAD sent by currently playing cart(s).

Cheers!


|-|
| Frederick F. Gleason, Jr. | Chief Developer |
|   | Paravel Systems |
|-|
|Beware of Programmers who carry screwdrivers.|
| |
|  -- Leonard Brandwein   |
|-|

___
Rivendell-dev mailing list
Rivendell-dev@lists.rivendellaudio.org
http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev


Re: [RDD] Updating scheduler codes via SQL

2021-07-14 Thread Fred Gleason
On Jul 14, 2021, at 05:14, Alejandro olivan Alvarez 
 wrote:

> I have messed a little with rivendell database, quite successfully, but only 
> for query/read operations ... altering/writing directly the database of such 
> a complex application is for the brave :-)

Just to amplify Alejandro’s point: directly modifying the Rivendell database is 
NOT A SUPPORTED METHOD for making changes in Rivendell! Specifically, the 
database schema CAN and DOES change between different versions of Rivendell; 
meaning that the update method that worked perfectly three months ago could end 
up NUKING YOUR DATABASE next time around.

A much better and safer method for making these sorts of site-specific bulk 
changes is to write a script that uses Rivendell’s WebAPI. See:

http://opsguide.rivendellaudio.org/apis/web_api.pdf

The Web API is a documented, public and above all stable interface; using it 
will allow you to write scripts that won’t break across different versions of 
Rivendell.

N.B. — If you insist on writing changes directly to the DB, be sure that you 
have a known good backup of it first. The sanity and gray hair (not to mention 
job) that you save may be your own.

Cheers!


|-|
| Frederick F. Gleason, Jr. | Chief Developer |
|   | Paravel Systems |
|-|
|Beware of Programmers who carry screwdrivers.|
| |
|  -- Leonard Brandwein   |
|-|

___
Rivendell-dev mailing list
Rivendell-dev@lists.rivendellaudio.org
http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev


[RDD] Putting in multiple RDCatch events in Bulk

2021-07-14 Thread Ryan Kin
Is there a way to bulk import a bunch of RDCatch events or have a feature
in Rivendell in the next release to take a xml like sheet or a .txt file
and ingest a bunch of RDCatch events and automatically start running based
off of the day and time set in the file defined based in RDCatch?

I am programming almost 20 shows weekly which RDCatch can grab but I am not
liking having to manually setting it up one-by-one since some shows are 2
to 5 hours long and it's a long process.
Thanks in advance!

Ryan
___
Rivendell-dev mailing list
Rivendell-dev@lists.rivendellaudio.org
http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev


Re: [RDD] Updating scheduler codes via SQL

2021-07-14 Thread Jarret Whetstone
When inserting via a select I don't think you need to use a subquery or
values statement..
see:
https://stackoverflow.com/questions/9422529/mysql-how-do-you-insert-into-a-table-with-a-select-subquery-returning-multiple-r

insert into CART_SCHED_CODES (CART_NUMBER, SCHED_CODE)
select NUMBER, '70s' from CART
where YEAR > str_to_date('1969', '%Y) and YEAR < str_to_date('1980', '%Y')

Of course, backup your database first :)

Jarret


On Wed, Jul 14, 2021 at 5:14 AM Alejandro olivan Alvarez <
alejandro.olivan.alva...@gmail.com> wrote:

> HI!
>
> I have messed a little with rivendell database, quite successfully, but
> only for query/read operations ... altering/writing directly the
> database of such a complex application is for the brave :-)
>
> On 7/13/21 10:14 PM, Dave B wrote:
> > I want to bulk update the scheduler codes for my songs based on the YEAR
> field, but I get an error when attempting to add songs to the
> CART_SCHED_CODES table. Sample SQL to add my 70s scheduler code to songs is:
> >
> > Insert into CART_SCHED_CODES (CART_NUMBER, SCHED_CODE) values ((select
> NUMBER from CART where YEAR > str_to_date(‘1969’, ‘%Y’) and YEAR <
> str_to_date(‘1980’, ‘%Y’)), ‘70s’);
>
> At first glance, I bet you can just use LIMIT on the subquery... and the
> specific (first) problem you encountered should be bypassed BUT... I
> don't think that being a good idea.
>
> At first glance, I see you're trying to insert TWO values into TWO
> fields (CART_NUMBER, SCHED_CODE) whereas you're subquerying for just ONE
> value (NUMBER) so I bet you'll need an additional field or the DBEngine
> may complain on that too.
>
> Then for the subquery itself, consider that If there are more than one
> result/row, you should decide which one is the right one... the DBEngine
> will never consider itself powerfull enough to impersonate you and take
> that decission by you... you have to tell it the criteria for such
> decission and the criteria must throw a single row, so you'll never
> could blame on the DBEngine for selecting the wrong one :-P
>
> Are all the subquery results equal? well... in that case the LIMIT trick
> could be enough, why not, but otherwise, you have to, at least try
> GROUPing BY and/or ORDERing BY the subquery results following your
> intended logic (and if the logic is complex maybe grouping/ordering
> wouldn't be enough... JOINining, etc... hopefully GROUing/ORDERing BY
> will be enough)
>
> My advice is that, first, you JUST work on the subquery ( just SELECT)
> playing with grouping, ordering, limiting (or whatever be necessary)
> until you get just the TWO unequivocal values you want to insert, from a
> SINGLE unequivocal result row... then paste that final query as the
> subquery of your 'parent' query and it should execute.
>
> Good luck, and best regards!
>
> >
> > This throws an error because the sub query returns more than one row.
> Any suggestions for correct SQL or a better way of doing this?
> >
> > Thanks,
> > Dave
> >
> > Sent from my iPad
> > ___
> > Rivendell-dev mailing list
> > Rivendell-dev@lists.rivendellaudio.org
> > http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev
> ___
> Rivendell-dev mailing list
> Rivendell-dev@lists.rivendellaudio.org
> http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev
>
___
Rivendell-dev mailing list
Rivendell-dev@lists.rivendellaudio.org
http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev


Re: [RDD] Updating scheduler codes via SQL

2021-07-14 Thread Alejandro olivan Alvarez

HI!

I have messed a little with rivendell database, quite successfully, but 
only for query/read operations ... altering/writing directly the 
database of such a complex application is for the brave :-)


On 7/13/21 10:14 PM, Dave B wrote:

I want to bulk update the scheduler codes for my songs based on the YEAR field, 
but I get an error when attempting to add songs to the CART_SCHED_CODES table. 
Sample SQL to add my 70s scheduler code to songs is:

Insert into CART_SCHED_CODES (CART_NUMBER, SCHED_CODE) values ((select NUMBER from 
CART where YEAR > str_to_date(‘1969’, ‘%Y’) and YEAR < str_to_date(‘1980’, 
‘%Y’)), ‘70s’);


At first glance, I bet you can just use LIMIT on the subquery... and the 
specific (first) problem you encountered should be bypassed BUT... I 
don't think that being a good idea.


At first glance, I see you're trying to insert TWO values into TWO 
fields (CART_NUMBER, SCHED_CODE) whereas you're subquerying for just ONE 
value (NUMBER) so I bet you'll need an additional field or the DBEngine 
may complain on that too.


Then for the subquery itself, consider that If there are more than one 
result/row, you should decide which one is the right one... the DBEngine 
will never consider itself powerfull enough to impersonate you and take 
that decission by you... you have to tell it the criteria for such 
decission and the criteria must throw a single row, so you'll never 
could blame on the DBEngine for selecting the wrong one :-P


Are all the subquery results equal? well... in that case the LIMIT trick 
could be enough, why not, but otherwise, you have to, at least try 
GROUPing BY and/or ORDERing BY the subquery results following your 
intended logic (and if the logic is complex maybe grouping/ordering 
wouldn't be enough... JOINining, etc... hopefully GROUing/ORDERing BY 
will be enough)


My advice is that, first, you JUST work on the subquery ( just SELECT) 
playing with grouping, ordering, limiting (or whatever be necessary) 
until you get just the TWO unequivocal values you want to insert, from a 
SINGLE unequivocal result row... then paste that final query as the 
subquery of your 'parent' query and it should execute.


Good luck, and best regards!



This throws an error because the sub query returns more than one row. Any 
suggestions for correct SQL or a better way of doing this?

Thanks,
Dave

Sent from my iPad
___
Rivendell-dev mailing list
Rivendell-dev@lists.rivendellaudio.org
http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev

___
Rivendell-dev mailing list
Rivendell-dev@lists.rivendellaudio.org
http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev