Wild media server (UPnP, DLNA, HTTP)
http://wildmediaserver.com/forum/

Library for user scripts
http://wildmediaserver.com/forum/viewtopic.php?f=19&t=1381
Page 1 of 1

Author:  krzychol [ Thu Jan 26, 2012 3:06 pm ]
Post subject:  Library for user scripts

I was wondering whether it's possible to have some of my scripts (Pascal functions) stored in one place, so that they could be used in many places of WMS.

Maybe it's going to be easier with an example...

I have several collections that are generated automatically using a script.
There's a separate collection for movies added to the library in last week, last month, last 3 months.
The only thing that is different in those scripts is the number of days since the movie has been added.
So what I did is I wrote a script that finds such movies and copied that script in 3 different collections (with only one thing being different - number of days sine media item has been added).

What happens now is that whenever I need to change something in the way movies are found within the library, I need to change the same script 3 times instead of doing this only once.

For me the best would be if I could do something like (sort of pseudo-code below):
Code:
Script1:
import (myFunction(int noDays))
myFunction(7);

Script2:
import (myFunction(int noDays))
myFunction(30);

Script3:
import (myFunction(int noDays))
myFunction(90);


Do you think something like that is even possible in PascalScript?
Maybe in other language supported by WMS - language is not a problem - the only thing is, I'd love to be able to import functions from some kind of general library of user functions...

Author:  Eugene [ Sat Jan 28, 2012 2:29 pm ]
Post subject:  Re: Library for user scripts

http://www.fast-report.com/pbc_download/files/fs_en.pdf

Code:
uses 'c:\temp\test.pas';

begin
  A
end.

c:\temp\test.pas
Code:
procedure A;
begin
  ShowMessage('A')
end;

begin

end.

Author:  krzychol [ Wed Feb 01, 2012 5:31 pm ]
Post subject:  Re: Library for user scripts

Great!
Exactly what I needed - works perfectly.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/