Script folder

If you have a suggestion for a feature, post it here
Post Reply
MetalHead-666
Posts: 15
Joined: Wed Jun 20, 2012 8:48 pm

Script folder

Post by MetalHead-666 » Wed Jun 20, 2012 8:55 pm

Hi,

I would like to see a folder scripts just visible like the transcode folder in each folder where I have my media files.

When opening scripts I would like to see just a listing of scripts that I can select and run just by using the remote and clicking.
Running scripts would be nice for people that can't code java but have .bat, .cmd or some powershell code that they want to launch.

This way people can make simple scripts to:
- reboot media server incl. OS
- shutdown mediaserver incl. OS
- Kill process in memory of mediaserver
- Stop any process like Antivirus before streaming
- enable any process when needed
etc, etc
I don't need output on my TV of the scripts, maybe showing an green or red icon when error-level=0 or not 0 when script has run.

User avatar
squadjot
Moderator
Posts: 651
Joined: Fri Jun 01, 2012 4:24 am

Re: Script folder

Post by squadjot » Sat Jun 30, 2012 12:51 am

I've been wanting this for a long time =)

I'd like UMS to be able run .bat .wsh files from ANY directory.. (using the path as 1st parameter, or simply use %0 in bat file, this would give some per-movie-functionality)

MetalHead-666
Posts: 15
Joined: Wed Jun 20, 2012 8:48 pm

Re: Script folder

Post by MetalHead-666 » Sat Jun 30, 2012 6:20 pm

Yep but for windows it's possible to set enviroment variables so we can use them aswell in our scripts :-)

User avatar
squadjot
Moderator
Posts: 651
Joined: Fri Jun 01, 2012 4:24 am

Re: Script folder

Post by squadjot » Sun Jul 01, 2012 1:53 pm

MetalHead-666 wrote:Yep but for windows it's possible to set enviroment variables so we can use them aswell in our scripts :-)
It's not what i meant..

try:

Code: Select all

ECHO The path of this batfile is: %0
PAUSE

MetalHead-666
Posts: 15
Joined: Wed Jun 20, 2012 8:48 pm

Re: Script folder

Post by MetalHead-666 » Sun Jul 01, 2012 8:36 pm

Hi,

It's just the same but by setting enviroment variables you can make it more flexible I think.

SET mediaformat = divx
Set currentdir=c:\media\movie

etc

You can use them in your script by
%mediaformat% and %currentdir% and so on
You can clear these variables and or change them at anytime.

Lot's of info already is known by UMS so setting some variables that can be used by external script would be nice.

Using %0, %1 is first of all not readable... just my 2 cents...

User avatar
SharkHunter
Developer
Posts: 669
Joined: Fri Jun 01, 2012 9:36 pm

Re: Script folder

Post by SharkHunter » Mon Jul 02, 2012 3:46 am

There (might) be thougths to add this to UMS. Maybe not what have been discussed here the last week (I've been on holiday) but its a start.
What I added is a simple script_dir variable to UMS.conf and then you'll take it from there.This is not merged yet so you can't try it out. I (as usually) was too fast and didn't read all of the messages her so I probably just added teh admin part and not the "transcode folder" part.

So more exactly what do you want to do in the "transcode" part? This should be possible to do for every media file so it has to get a lot of arguments/env. vars if it should be able to cope with everything.
We reject: kings, presidents and voting.
We believe in: rough consensus and running code.

MetalHead-666
Posts: 15
Joined: Wed Jun 20, 2012 8:48 pm

Re: Script folder

Post by MetalHead-666 » Thu Jul 05, 2012 7:09 pm

The idea I got was to see a ''folder' scripts at the same place where you can see the transcode folder.

When opening the scripts folder, a list of available scripts will be displayed and by selecting a script it runs/executes

This would be a start, arguments/env. vars passing can be added/defined in UMS in the future when needed.

User avatar
SharkHunter
Developer
Posts: 669
Joined: Fri Jun 01, 2012 9:36 pm

Re: Script folder

Post by SharkHunter » Mon Jul 09, 2012 11:39 pm

Hi,

I add what I call "stream vars to my Channels plugin. Take a look as this could (read will) be use as a base for UMS. Basically you'll add to some conf file

Code: Select all

var {
	disp_name=MyVar
        values=1,2,3
	suffix=seconds
	action=myScript.bat
}
and the script

Code: Select all

myscript.bat
will be called (with some parameters one being the value 1, 2 or 3) and it will be expected to return a list of all variables to add (for example -xxx abc or -a 1 etc.)
These will then be added to the transcode argument.

This is not working 100% yet so feedback is welcome. If you wan't to do a real test spin and add your own scripts add this file (call it stream.var) to your channels path and sections like the on above.

Code: Select all

version=0.11

var {
	disp_name=Max Bitrate
	var_name=max_br
	values=100,75,50,25,10
	suffix=%
	action=maxBrStream
}

var {
	disp_name=Init Buffer Delay
	values=1000,2000,5000,10000
	default=6000
	type=inc
	suffix=milliseconds
	action=bufferDelay
}

var {
	disp_name=Subtitle Delay
	suffix=seconds
	type=inc
	action=subDelay
}
We reject: kings, presidents and voting.
We believe in: rough consensus and running code.

Post Reply