AnthonyMusgrove / Emby-ScripterX

Run custom external application or script (batch/bash/powershell/php/python/node.js/custom) on various events within the Emby Server.
https://emby-scripterx.com
78 stars 6 forks source link

'Test' button for an Action #3

Closed AnthonyMusgrove closed 2 years ago

AnthonyMusgrove commented 4 years ago

Is your feature request related to a problem? Please describe. It is easy to make a typo or incorrect formatting at times, and usually doesn't get picked up until an Event has fired, which could take time depending on what that event is.

Describe the solution you'd like A simple 'Test' button for an Action that will fire the Event with dummy data so that you can check that your script received the correct data, and the script does what it is designed to do

AnthonyMusgrove commented 4 years ago

We just need to confirm what type of dummy data it should use - should I create dummy data that would suit each event?

like dummy_data_onPlaybackStart = (movie = ScripterX Test Movie, etc) or should it just interpret the tokens and pass their name to your script, ie %item.name% would change to ItemName, so we know its been validated, or ItemName.Validated, or?

Thanks mate :)

Penkethboy commented 4 years ago

Basically i see this as testing i have typed in everything ok and ScripterX is happy with it

I.e. if i type %item.Name% (as we are case sensitive) then it should Fail in some why so its obvious in the what ScripterX returns - and if happy %item.name% -> item.name say would be fine.

ginjaninja1 commented 4 years ago

For Media Events especially it would be helpful for plugin to retrieve and be able to use some test data. I am thinking the test button would fire event (call script with parameters) for a particular ID. And a page in ui would help user find an id (eg 1st one) in database of chosen type (episode,season,series,Audio,MusicAlbum,Movie, Folder) and use that ID on the test button for media events.

Penkethboy commented 4 years ago

to be honest - i only wanted this to test the %variables% - if they are valid - too keep it simple - as they are not case sensitive anymore - it just comes down to spelling.

Adding in getting data from emby adds a level of complexity that not sure from my perspective would be needed - as you could add a "hard coded" ID to the parameters line - and test that once the test button is added.

ginjaninja1 commented 4 years ago

from my perspective, as i am developing a script and testing it, i have to keep removing and readding stuff from my library to get events to fire. A useful test for me in this case would be an onmediaitemadded event for a particular object, without me changing the parameters or my script to support the test. ie quickly test a series add, season add, episode add. not a big deal as i can do manual changes to the filesystem to achieve this too. edit i guess for media item events it might be important that the disk situation matches the event situation, so perhaps virtual tests are not so great