External Actions not working?
#1
I'm trying to get the external actions working with my setup. I'm trying to get them to trigger a batch file to run the wtv-metarenamer powershell script after a recording has finished, and as of yet it just does nothing.

Here's the segment from my config.xml -

Code:
<RecordingExternalAction>
  <ExternalAction>
  <RecordingState>HasOccurred</RecordingState>
  <Program>D:\RunRenamer.bat</Program>
  <Arguments />
  </ExternalAction>
  </RecordingExternalAction>

Actions enabled, status is changing confirmed via logs -
Code:
2014/02/18 11:21:47.380    Debug_LogRecordingStatusChanges: True >>Default: False
2014/02/18 11:21:47.380    RecordingExternalActionEnabled: True >>Default: False
2014/02/18 11:22:32.330    RecordingStatus> Recording Scheduled 33/Food Factory: Status changed from WillOccur to IsOccurring
2014/02/18 11:35:02.160    RecordingStatus> Recording Scheduled 33/Food Factory: Status changed from IsOccurring to HasOccurred

But the script never runs? Every time it does it makes a log file, so I'm sure it's not even getting to that point. I can run the batch file manually and everything works just as it should, so it appears it just isn't getting triggered.

I've tried double and single quotes around the program path, tried <arguments></arguements> and the way it is above and neither works. I copied the XML right from the post on external actions so hopefully there wouldn't be any syntax errors.. Considering the debug only shows the record state change and nothing after that, any ideas what I'm doing wrong? Do you HAVE to specify arguments?

Thanks for the help!
Reply
#2
So nothing else is ever said about it after those messages? The only way that can happen is if external actions are disabled, or none are defined. Otherwise there should be some sort of additional log messages in all cases.

Eg:
ExternalActions are defined, but none match this transition:
"RecordingStatus> Recording {0}: No external actions match this recording state {1}"

Error when formatting arguments:
"RecordingStatus> Recording {0}: Run external action: Error determining details of recording: {1}"

Starting to run the action:
"RecordingStatus> Recording {0}: Run external action: {1} {2}"

Action completed:
"RecordingStatus> Recording {0}: Run external action: Succesful (PID {1}"

Action failed:
"RecordingStatus> Recording {0}: Error running external action: {1}"


So yeah it seems that the only way for it to say nothing after it logs the state transition, is if RecordingExternalActionEnabled == false or RecordingExternalActionList.Count <= 0

The ExternalActions should be enumerated on startup, so post up the whole log to pastebin and let's go from there. It should be able to work without any arguments specified (although wouldnt it be better for you to pass in the filename to your script so it only deals with the recording that has just completed?)
pvr.wmc TV addon and ServerWMC Backend Development Team
http://bit.ly/ServerWMC
Reply
#3
I also change the logger so if external actions are input they are listed just after the non-default settings. I assume they aren't getting listed otherwise exodus would have seen them. I don't check RecordingExternalActionEnabled, so the only way they wouldn't get listed is if RecordingExternalActionList is null or RecordingExternalActionList.Count is 0
Windows Media Center PVR addon (pvr.wmc) and server backend (ServerWMC)
http://bit.ly/serverwmc
Reply
#4
http://pastebin.com/GPaKAM4L

There's the log during a recording test, let me know if you need anything else.. I might be blind, but I didn't see anything else external action related in the logs. Also scarecrow, I probably will end up trying to pass only the one filename, I just wanted to get it working at all before throwing more complication in the mix.
Reply
#5
It should be logging

--- RecordingExternalActionList:
Action1
Action2

etc, if it had picked any up. So either we have a bug where we aren't getting them from the config file, or your config file isn't correct. Make sure you don't have more than 1 <RecordingExternalActions> section? I wonder if you left the default empty one there <RecordingExternalActions /> and added a duplicate section with your actions in it?

Infact, maybe post your config file to pastebin or PM it to me, so i can see if it's a formatting problem. Sorry for making it a hand edit function, I prefer to focus on writing the actual guts of things rather than the UI to configure it Wink

Actually in your first post, you had posted <RecordingExternalAction> whereas i think it's meant to be <RecordingExternalActions> (note the s on the end!). And yes I realise that's because my post in the Feature Request thread also had this typo,. so it's all my fault!! Smile Good news is that hopefully this fixes your problem!
pvr.wmc TV addon and ServerWMC Backend Development Team
http://bit.ly/ServerWMC
Reply
#6
Ahhh I bet that's it! I had a feeling it was something stupid haha. I hope that's it anyway, easy fixes are nice every once in awhile.

I'll try that out and report back!
Reply
#7
Yup, that did it! Everything is working as it should be now.

2014/02/19 20:05:01.225 RecordingStatus> Recording Scheduled 9/The Big Bang Theory: Status changed from IsOccurring to HasOccurred
2014/02/19 20:05:01.227 RecordingStatus> Recording Scheduled 9/The Big Bang Theory: Run external action: D:\RunRenamer.bat
2014/02/19 20:05:01.248 RecordingStatus> Recording Scheduled 9/The Big Bang Theory: Run external action: Succesful (PID 47320

Very cool, thanks for the help again!
Reply
#8
cool! Sorry about that typo, leading us all down the garden path for a while Smile

Glad it's working, please let me know after while how you find it, if it's still working etc. Are you going to pass the file name as parameter now?
pvr.wmc TV addon and ServerWMC Backend Development Team
http://bit.ly/ServerWMC
Reply
#9
It's no big deal, at least you guys are actively on the forums here supporting your creation! It's really awesome being able to get quick help with this stuff.

So far it's working beautifully - it's really nice to have it just take care of pulling the metadata out of the wtv file, rename and move it automatically with minimal screwing around from my end. I will say though, I REALLY wish WMC was more consistent with the damn metadata, that's always driven me up the freakin' wall with how hit or miss it is. I'm planning to get it accepting single files as soon as I have the time to play with it, which hopefully will be tonight or tomorrow. As far as syntax for passing the filename goes, will serverwmc pass the entire path or just the filename?
Reply
#10
It will pass the entire path. Also the ServerWMC.log will log the parameters as well so you can troubleshoot/debug if necessary. You should put quotes around any parameters yourself if there could be spaces in them and the external program doesnt handle that etc
pvr.wmc TV addon and ServerWMC Backend Development Team
http://bit.ly/ServerWMC
Reply

Logout Mark Read Team Forum Stats Members Help
External Actions not working?0