ElvishArtisan / rivendell

A full-featured radio automation system targeted for use in professional broadcast and media environments
197 stars 63 forks source link

4.1.3 Pypad pypad_filewrite.py NowGroups filter shuts off all titles; return now/next to rdadmin/groups GUI? #946

Closed paulk-2 closed 1 month ago

paulk-2 commented 3 months ago

4.1.3 /usr/lib/rivendell/pypad/pypad_filewrite.py

Works: Without NowGroups specified, titles get written to song.dat from all groups.

Filename=/home/rd/Desktop/startup/song.dat Append=0
FormatString=%t | %a | %l

No output: When I add NowGroups, all output stops, no matter what groups I specify (I have almost 60). Tried matching case, all upper case, all lower case.

Filename=/home/rd/Desktop/startup/song.dat Append=0 FormatString=%t | %a | %l

[NowGroups] GROUP1=MU-Pop

Having now/next specified in Rdadmin/groups enabled operators to set up a new group and check a box. Now operators are expected to:

I recommend returning the now/next checkbox to the GUI, even though it's now redundant.

KeepEmGoing commented 3 months ago

I also found inconsistent or incorrect behavior with this as well. If I don't add groups, nothing is written to the text file. If I add the groups that I want to show in the metadata, all groups are written to the metadata text file. We need a filter that works. I believe that this behaves the same for other pypad scripts as well such as with the pypad_ino713_tcp.py. Fortunately, there is a time out feature on the RDS unit allowing for a generic text replacement.

paulk-2 commented 3 months ago

For now, I have added code to an existing bash title processing script that filters titles based on groups. If anyone would like key excerpts from this, just ask.
I added the groups field to the pypad output fields, then used it to compare against the list of desired groups. Then the processed title gets passed on to the transmitter and streaming provider.

KeepEmGoing commented 3 months ago

Thanks for sharing this. Yes, I would like to see what you did. I’m not (yet) a python coder but have done simple bash scripting.

Tom

From: paulk-2 @.> Sent: Monday, March 11, 2024 5:39 PM To: ElvishArtisan/rivendell @.> Cc: Tom VanGorkom @.>; Comment @.> Subject: Re: [ElvishArtisan/rivendell] 4.1.3 Pypad pypad_filewrite.py NowGroups filter shuts off all titles; return now/next to rdadmin/groups GUI? (Issue #946)

You don't often get email from @.**@.>. Learn why this is importanthttps://aka.ms/LearnAboutSenderIdentification

For now, I have added code to an existing bash title processing script that filters titles based on groups. If anyone would like key excerpts from this, just ask. I added the groups field to the pypad output fields, then used it to compare against the list of desired groups. Then the processed title gets passed on to the transmitter and streaming provider.

— Reply to this email directly, view it on GitHubhttps://github.com/ElvishArtisan/rivendell/issues/946#issuecomment-1989565870, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BFO6TXCVYJK3MOGALHMH7QTYXY6A5AVCNFSM6AAAAABELAA35WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBZGU3DKOBXGA. You are receiving this because you commented.Message ID: @.**@.>>

paulk-2 commented 3 months ago

Here is group filtering code extracted from a much larger RDS processing script - enjoy!

demo/sample sample code sections to filter non-music titles from RDS

this file is untested, but has extracted code from a working RDS to transmitter interface script

use pypad_filewrite.py and this format string (ignore comment delimiter #):

FormatString=%t | %a | %l~%g

group is tagged at the end with tilde ~

init

message="WXYZ RDS title for non-music carts. could be blank or station ID." songdat="song.dat"

groups where titles will be passed to RDS. others replaced by message above

groups="MUSIC COUNTRY CLASSICAL"


loop that monitors song.dat

while true do

get title from song.dat and strip weird characters

rawnewtitle=$(tail -n 1 $songdat | iconv --from-code=ISO-8859-1 --to-code=UTF-8) echo rawnewtitle=$rawnewtitle

tear off group name

group="${rawnewtitle#~}" echo "group="$group rawnewtitle=${rawnewtitle%~} # remove suffix starting with "~" echo "rawnewtitle without group="$rawnewtitle

echo "music groups: "$groups echo "logic test" if [[ "$groups" != "$group" ]]; then echo "not a music group, don't pass to RDS" rawnewtitle="$message" else echo "this is a music group, pass title unchanged to RDS" fi

insert code to further format and transmit RDS to transmitter here

wait 2 seconds before checking for new title

sleep 2

end of loop

done

ElvishArtisan commented 2 months ago
[NowGroups]
GROUP1=MU-Pop

The section and directive names are case-sensitive. Try:

[NowGroups]
Group1=MU-Pop
paulk-2 commented 1 month ago

Any thoughts on the suggestion to return this to the GUI?

from the original post:

Having now/next specified in Rdadmin/groups enabled operators to set up a new group and check a box. Now operators are expected to:

I recommend returning the now/next checkbox to the GUI, even though it's now redundant.

ElvishArtisan commented 1 month ago

The problem with the 'checkbox GUI' is that it's an extremely blunt instrument -- it lets one send updates for the group to all plug-in instances, or to none. Life is more complicated than that; it's not uncommon for one to want a particular group sent to some instances, but not to others.

paulk-2 commented 1 month ago

Unfortunately, I still can't get titles when group filtering is on:

[File1] Filename=/home/rd/Desktop/startup/song.dat Append=0 FormatString=%t | %a | %l [NowGroups] Group1=MU-Pop Encoding=0

If I comment out [NowGroups] and Group1, the titles flow. "MU-Pop" is an exact case match.