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
76 stars 6 forks source link

Additional system capabilities #42

Closed Slugger closed 2 years ago

Slugger commented 4 years ago

Is your feature request related to a problem? Please describe. Some of my integration plans require access to the emby server. Specifically, I need access to two things:

  1. Access to the Emby server's file system information (via say System.IO.DriveInfo)
  2. Access to run processes on the system (via say System.Diagnostics.Process)

Describe the solution you'd like Need access to more of the .Net runtime from package js code

Describe alternatives you've considered n/a

Additional context I'd be happy with just adding the above to the ScripterX namespace, but thinking long term, if there was a way I could just request inclusion of any of the .net packages I needed, that would be ideal. Of course, I'm not considering security implications of such a thing, I'll leave that that to you. ;) But if I could just do a

var Process = ScripterX.DotNetCore.Import('System.Diagnositics.Process');
// Use Process as I see fit

That would save me from adding these kinds of feature requests anytime I need another piece of the .net core made available to my js. Of course the security implications of providing such access would have to be considered carefully.

On the other hand, I also love the idea of you providing a ScripterX.Process.execute(exe) that returns let's say a ProcessResult with exit code, stdout, stderr, etc. all managed and dealt with by ScripterX. A more secure/controlled environment for sure.

I'm open to either sol'n, but would like access to be able to launch processes and query the emby server file system one way or the other. Personally, the ScripterX.Process.execute() sol'n is easier for me, but probably a lot more work for you. :) But also probably more secure.