Library for user scripts
Posted: Thu Jan 26, 2012 3:06 pm
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):
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...
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: Select all
Script1:
import (myFunction(int noDays))
myFunction(7);
Script2:
import (myFunction(int noDays))
myFunction(30);
Script3:
import (myFunction(int noDays))
myFunction(90);
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...