SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV v7 Customizations
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV v7 Customizations This forums is for discussing and sharing user-created modifications for the SageTV version 7 application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss plugins for SageTV version 7 and newer.

Reply
 
Thread Tools Search this Thread Display Modes
  #181  
Old 12-28-2010, 11:59 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by hchucky View Post
Is there a way to disable the prompting for a Task and Trigger Event when setting up a manual recording?

HC
Not currently. You may want to open a ticket for that and tmiranda will look at it when he's back in dev mode (likely after the holidays).
__________________
Twitter: @ddb_db
Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive
Capture: 2 x Colossus
STB Controller: 1 x USB-UIRT
Software:Java 1.7.0_71; SageTV 7.1.9
Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter
Plugins: Too many to list now...
Reply With Quote
  #182  
Old 12-28-2010, 12:21 PM
hchucky hchucky is offline
Sage Advanced User
 
Join Date: Jun 2004
Posts: 140
Quote:
Originally Posted by Slugger View Post
Not currently. You may want to open a ticket for that and tmiranda will look at it when he's back in dev mode (likely after the holidays).
Thanks. Done, 275

HC
Reply With Quote
  #183  
Old 12-28-2010, 01:20 PM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
Quote:
Originally Posted by hchucky View Post
Is there a way to disable the prompting for a Task and Trigger Event when setting up a manual recording?

HC
I'm not sure what you mean by this statement. You should never HAVE to setup a Task. Can you explain in a little more detail please?
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
  #184  
Old 12-28-2010, 01:26 PM
BobPhoenix BobPhoenix is offline
SageTVaholic
 
Join Date: Oct 2004
Posts: 3,152
If it is the same as below then good. Otherwise ignore this post as worthless chatter that I will delete later after hchucky's reply.

From program guide I select a show to record and press the "Record" button on the remote for a manual record. A popup displays "Task and Trigger Events"
Reply With Quote
  #185  
Old 12-28-2010, 02:59 PM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
Quote:
Originally Posted by BobPhoenix View Post
From program guide I select a show to record and press the "Record" button on the remote for a manual record. A popup displays "Task and Trigger Events"
Got it! Thanks.
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
  #186  
Old 12-28-2010, 03:02 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
How exactly do the return codes work and what do I have to change to make comskip return the correct status. I looked through the wiki fies but I couldn't find this anywhere.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #187  
Old 12-28-2010, 03:16 PM
voidpt's Avatar
voidpt voidpt is offline
Sage Aficionado
 
Join Date: Jan 2006
Location: Norway
Posts: 296
Trying to get into this SJQv4, tasks & groovy thingy. Have assigned my own custom task called "POSTJOB". Set to be run on "RecordingStopped". Will run my VideoReDo quickfix & comskip stuff. Got that to work.

But now I want to expand my checking a little. Have some special stuff that is to delete a recording I do each night (keeps up the stability of my CAM/SmartCards, plus: needed for my EPG grab each night).

In short: I started looking at SJQ4_CHAN_NAME & SJQ4_TITLE. Both are empty ? Then started checking the SJQ4_TYPE. It is set to "MediaFile", for all my recordings ? Shouldn't it be "Airing" ? Giving the metadata I need. Or am i missing something ?
__________________
SageTV 7.1.9 (headless/service) JavaRE 1.6.0_37 2x FloppyDTV C/CI (DVB-C) (fw: 1.2.10 B43110) (CAM: Conax) Win7 x64 Intel E3-1245V2 3.4GHz 16GB PC3-10600 ECC ASUS P8C WS (Intel C216) APC Back-UPS RS 800 STP-HD300 Extender (fw: beta 20110506 0) - HDMI/SPDIF - Yamaha RX-V2700 - HDMI - Sony KDL-52X2000
Reply With Quote
  #188  
Old 12-28-2010, 03:19 PM
hchucky hchucky is offline
Sage Advanced User
 
Join Date: Jun 2004
Posts: 140
Quote:
Originally Posted by BobPhoenix View Post
If it is the same as below then good. Otherwise ignore this post as worthless chatter that I will delete later after hchucky's reply.

From program guide I select a show to record and press the "Record" button on the remote for a manual record. A popup displays "Task and Trigger Events"
Yes, this is exactly what I was referring to.

HC
Reply With Quote
  #189  
Old 12-28-2010, 03:42 PM
voidpt's Avatar
voidpt voidpt is offline
Sage Aficionado
 
Join Date: Jan 2006
Location: Norway
Posts: 296
Quote:
Originally Posted by voidpt View Post
I started looking at SJQ4_CHAN_NAME & SJQ4_TITLE. Both are empty ? Then started checking the SJQ4_TYPE. It is set to "MediaFile", for all my recordings ? Shouldn't it be "Airing" ? Giving the metadata I need. Or am i missing something ?
Never mind (I think ). If I understand this correctly. All media objects only are "Airing" while they actually are recording. At the moment they finish, they become "MediaFile". Correct ?

Anyway. Did the following:
Code:
Object objAiring = MediaFileAPI.GetMediaFileAiring(objMediaFile);
string strChanName = AiringAPI.GetAiringChannelName(objAiring);
Looks to work ok. At least I'm getting the channel name for recording.

@Slugger: Thanks for the "," vs. "." on SQL fix. Everything solved for my regional settings
__________________
SageTV 7.1.9 (headless/service) JavaRE 1.6.0_37 2x FloppyDTV C/CI (DVB-C) (fw: 1.2.10 B43110) (CAM: Conax) Win7 x64 Intel E3-1245V2 3.4GHz 16GB PC3-10600 ECC ASUS P8C WS (Intel C216) APC Back-UPS RS 800 STP-HD300 Extender (fw: beta 20110506 0) - HDMI/SPDIF - Yamaha RX-V2700 - HDMI - Sony KDL-52X2000
Reply With Quote
  #190  
Old 12-29-2010, 03:17 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
I am trying to get my Transcode jobs working via SJQv4. A couple of questions/comments:
  1. Do you need an executable for internal tasks like running a transcode job? For now I am running a dummy batch file as you can't leave the field blank.
  2. It appears that the SJQ4_EPISODE variable doesn't work as it is always showing up null for me (I am trying SJQ4_METADATA.get("SJQ4_EPISODE")). To get around this I am using ShowAPI.GetShowEpisode(mf).
  3. At times when I go into Show Completed Tasks and go to look at the logs it will say there are no completed tasks. But when I back out and come back in the tasks are there.
  4. Is there any easy way of getting the original file name without the extension? Or do I manually have to do string operations to remove the extension? If so does anyone have a quick routine to do so?

Here is my error:
Code:
LOG4J: Configured Logging for: sagex-api using file: sagex-api.log4j.properties
javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: sagex.api.TranscodeAPI.AddTranscodeJob() is applicable for argument types: (sagex.remote.RemoteObjectRef, java.lang.String, java.lang.String, java.lang.Boolean) values: [RemoteObjectRef[29225822];, MPEG4-Good Quality AVI, \\Carnoustie\Videos\Isabella's Shows\Toopie and Binoo\Sparkle Binoo; Toopy's Surprise; Sky Friends; Binoo's Birthday.avi, false]
Possible solutions: AddTranscodeJob(java.lang.Object, java.lang.String, java.io.File, boolean), AddTranscodeJob(sagex.UIContext, java.lang.Object, java.lang.String, java.io.File, boolean), AddTranscodeJob(java.lang.Object, java.lang.String, java.io.File, boolean, long, long), GetTranscodeJobs(), AddTranscodeJob(sagex.UIContext, java.lang.Object, java.lang.String, java.io.File, boolean, long, long)
Could the problem be coming from the complexity of the filename which has semi-colons?

edit - I tried it with simpler filenames without semi-colons and I get the same error.
Will this line (which I stole from Slugger's comskip.groovy file) work for my final question: fileName.substring(0, fileName.lastIndexOf('.'))
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server

Last edited by wayner; 12-29-2010 at 03:23 PM.
Reply With Quote
  #191  
Old 12-29-2010, 10:40 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Do you need an executable for internal tasks like running a transcode job? For now I am running a dummy batch file as you can't leave the field blank.
You always need an exe. You do NOT need a test. Sounds like you should move the groovy script you're using as the test to your exe (prefix it with 'script:' when using it as an exe).

Quote:
It appears that the SJQ4_EPISODE variable doesn't work as it is always showing up null for me (I am trying SJQ4_METADATA.get("SJQ4_EPISODE")). To get around this I am using ShowAPI.GetShowEpisode(mf).
SJQ4_EPISODE would only be set if the metadata was being attached for an Airing. When dealing with recordings, SJQ will always grab metadata for the associated MediaFile, not the Airing. So SJQ4_EPISODE will not be set. As you've discovered, you just need to pull it out on your own as you've done.

Quote:
At times when I go into Show Completed Tasks and go to look at the logs it will say there are no completed tasks. But when I back out and come back in the tasks are there.
Open a ticket for tmiranda, please (at the sagetv-addons project site). Attach SageClient log files for the STV (ideally showing errors/exceptions when this happens). I believe I've even seen this happen once or twice, but not consistently nor frequently enough for me to try to reproduce it and open a ticket for it.

Quote:
Is there any easy way of getting the original file name without the extension? Or do I manually have to do string operations to remove the extension? If so does anyone have a quick routine to do so?
Star ticket 271, which someone else opened for adding more vars, including this one.

Quote:
Here is my error:
Code:
LOG4J: Configured Logging for: sagex-api using file: sagex-api.log4j.properties
javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: sagex.api.TranscodeAPI.AddTranscodeJob() is applicable for argument types: (sagex.remote.RemoteObjectRef, java.lang.String, java.lang.String, java.lang.Boolean) values: [RemoteObjectRef[29225822];, MPEG4-Good Quality AVI, \\Carnoustie\Videos\Isabella's Shows\Toopie and Binoo\Sparkle Binoo; Toopy's Surprise; Sky Friends; Binoo's Birthday.avi, false]
Possible solutions: AddTranscodeJob(java.lang.Object, java.lang.String, java.io.File, boolean), AddTranscodeJob(sagex.UIContext, java.lang.Object, java.lang.String, java.io.File, boolean), AddTranscodeJob(java.lang.Object, java.lang.String, java.io.File, boolean, long, long), GetTranscodeJobs(), AddTranscodeJob(sagex.UIContext, java.lang.Object, java.lang.String, java.io.File, boolean, long, long)
Could the problem be coming from the complexity of the filename which has semi-colons?

edit - I tried it with simpler filenames without semi-colons and I get the same error.
The file name needs to be converted to a java.io.File object. Wrap the file name in a 'new File(file)' call.

Quote:
Will this line (which I stole from Slugger's comskip.groovy file) work for my final question: fileName.substring(0, fileName.lastIndexOf('.'))
Yes, that line of code will get the entire file name less the file extension.
__________________
Twitter: @ddb_db
Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive
Capture: 2 x Colossus
STB Controller: 1 x USB-UIRT
Software:Java 1.7.0_71; SageTV 7.1.9
Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter
Plugins: Too many to list now...

Last edited by Slugger; 12-29-2010 at 10:43 PM. Reason: Not a remote API bug, but a script bug; method call expecting File, received String
Reply With Quote
  #192  
Old 12-29-2010, 10:50 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
@wayner Please note my edit to the above reply. There is no bug with the remote APIs, it's a bug with your groovy script. (Caught it after rereading the post and before bugging Sean ) The call to AddTranscodeJob() expects a File parameter for the file name, not a string. Wrap the file name string in a 'new File()' call. Should fix you up.

i.e.

Code:
AddTranscodeJob(mf, "MPEG4-Good Quality AVI", new File("\\Carnoustie\Videos\Isabella's Shows\Toopie and Binoo\Sparkle Binoo; Toopy's Surprise; Sky Friends; Binoo's Birthday.avi"), false)
Not so sure if the semicolons in the file name is a good idea, but I'm sure you'll find out if it is or isn't. Either way, you need to convert the new file name string you constructed into a File object and pass that as the arg to AddTranscodeJob()
__________________
Twitter: @ddb_db
Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive
Capture: 2 x Colossus
STB Controller: 1 x USB-UIRT
Software:Java 1.7.0_71; SageTV 7.1.9
Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter
Plugins: Too many to list now...
Reply With Quote
  #193  
Old 12-30-2010, 11:27 AM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
Thanks Slugger, that did the trick. I assume that I can pass other parameters to my script, such as the folder where the output file of the transcode should be stored? This would save me having to do a different script for every show.

One other question - how do I change the return code settings to deal with the wonkiness of how Comskip is different from other programs?
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #194  
Old 12-30-2010, 11:45 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by wayner View Post
Thanks Slugger, that did the trick. I assume that I can pass other parameters to my script, such as the folder where the output file of the transcode should be stored? This would save me having to do a different script for every show.
Yes, you can pass anything as parameters (just edit the task setup in SJQ). But you shouldn't need to pass parameters, you should just dynamically generate them based on the MediaFile ID that's already being passed to the script (SJQ4_ID). With that said, people should be learning there's about 10,000 different ways to accomplish any single task in SJQv4. With Groovy scripting, etc., the sky's the limit here. So how I think something should be done is just one way to do it - anyway that makes sense to you is just as valid. This is what I was aiming for in this release. Provide the tools and the base environment (Groovy, task queue, crontab) then let users accomplish their tasks in any way they can imagine.

Quote:
One other question - how do I change the return code settings to deal with the wonkiness of how Comskip is different from other programs?
Edit the task on a task client and set the min and max return codes for the task(s) that run comskip. Set the min to 0 and the max to 1. Do it via the UI or directly modify the sjqagent.properties file; either way is valid.
__________________
Twitter: @ddb_db
Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive
Capture: 2 x Colossus
STB Controller: 1 x USB-UIRT
Software:Java 1.7.0_71; SageTV 7.1.9
Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter
Plugins: Too many to list now...
Reply With Quote
  #195  
Old 12-30-2010, 12:18 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
Quote:
Originally Posted by Slugger View Post
Yes, you can pass anything as parameters (just edit the task setup in SJQ). But you shouldn't need to pass parameters, you should just dynamically generate them based on the MediaFile ID that's already being passed to the script (SJQ4_ID).
The issue is that I want to pass the folder names to the script since the folder names that I use may be slightly different than the show name - for example /Dora/ rather than "Dora the Explorer" or /Diego/ rather than "Go, Diego, Go!". There really isn't a way of getting the folder name from the show.

I guess I could rename the folders but I don't know if that would hose my existing metadata since the file paths will have changed. And having commas and exclamation points in folder names is likely also a bad idea.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #196  
Old 12-30-2010, 12:59 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Ok, you can pass args to scripts (in the task setup screen/props file), but it can't be done dynamically (right now). Someone else opened a ticket (I think - edit: maybe not, don't see it) for that feature, but unless you can somehow generate the folder name dynamically, I think you're going to be stuck with a task for each show regardless if dynamic cmd args is added. The best alternative I can think of off the top of my head is to put a hashmap at the top of your groovy script that maps the shows to folder names and then use that in your groovy script. Then you just add shows to the hashmap as necessary.
__________________
Twitter: @ddb_db
Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive
Capture: 2 x Colossus
STB Controller: 1 x USB-UIRT
Software:Java 1.7.0_71; SageTV 7.1.9
Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter
Plugins: Too many to list now...
Reply With Quote
  #197  
Old 12-30-2010, 01:12 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
That is what I as thinking - I will have to create a separate task for each show, but at least they should be able to share the same groovy script. If I am passing a parameter with spaces should I be encasing it in quotes?

By the way, is there any easy way to test your scripts. I have been going into TV and manually assigning a SJQ task. I then have to go back to Setup/SJQ/Show Completed (or Queued) Tasks to check the logs to see if everything is working. I guess I could go into the lobs folder but that requires you to be on a PC with mapping to the system drive of the server.

Also - is there a way to run my groovy scripts outside of Sage/SJQ to check for stuff like Syntax, etc. Is there a groovy interpreter/compiler that you would recommend? I guess it wouldn't be able to handle stuff like SJQ Env vars but it would allow you to check your syntax, string manipulation, etc and to learn groovy.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #198  
Old 12-30-2010, 01:45 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by wayner View Post
That is what I as thinking - I will have to create a separate task for each show, but at least they should be able to share the same groovy script. If I am passing a parameter with spaces should I be encasing it in quotes?
I wouldn't do it that way, it'll work so don't let me stop you, but I'd use the same task and then just add a hash map at the top of the groovy script:

Code:
def folderMap = ["Blah Blah":"blah", "Another Show!!", "Show"] // etc...
Then just pull the show name from the media file obj and then grab the predefined folder from that hashmap. No need for separate tasks for every show. Lot less maintenance. Just my opinion. Either way should work fine.

Yes, args with spaces need to be double quoted.

Quote:
By the way, is there any easy way to test your scripts. I have been going into TV and manually assigning a SJQ task. I then have to go back to Setup/SJQ/Show Completed (or Queued) Tasks to check the logs to see if everything is working. I guess I could go into the lobs folder but that requires you to be on a PC with mapping to the system drive of the server.
I have my set of tools, basically the GUI editor included with the Groovy distro, modded to support (most) of the SJQ env. It works fine for me, but it's hardly ready for primetime. Once I get back into Sage dev mode I'll clean it up and get a zip file out for people. It allows you to edit a script and run it directly in the editor. There are lots of caveats to using it though, which is why it hasn't seen the (public) light of day yet.

Quote:
Also - is there a way to run my groovy scripts outside of Sage/SJQ to check for stuff like Syntax, etc. Is there a groovy interpreter/compiler that you would recommend? I guess it wouldn't be able to handle stuff like SJQ Env vars but it would allow you to check your syntax, string manipulation, etc and to learn groovy.
It's the inability to handle the SJQ vars, etc. that makes the Groovy GUI editor a bit of a problem. It works, but unless you prep the SJQ env, all your scripts fail with undefined var errors, etc. I've fixed that, but it needs to be cleaned up. It'll be an unsupported tool, but it's a nice one for people who really want to get in there and work on some more advanced groovy scripting. Basically, it's just the Groovy GUI editor (you actually already have it installed in the SageTV\JARs folder - it's all contained in the groovy jar that's in there. However, you need to add a lot of additional stuff to make it run scripts that run in SJQ. The screenshot shows the editor I'm using - modded to support the SJQ env outside of SageTV (via remote APIs).
Attached Images
File Type: jpg sjq4_11.jpg (66.3 KB, 192 views)
__________________
Twitter: @ddb_db
Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive
Capture: 2 x Colossus
STB Controller: 1 x USB-UIRT
Software:Java 1.7.0_71; SageTV 7.1.9
Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter
Plugins: Too many to list now...
Reply With Quote
  #199  
Old 12-30-2010, 01:59 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
That looks useful since I have no idea how to use groovy so it is nice to try out scripts of the "Hello World" type.

How exactly to Hashmaps work? Let's say I have "Dora The Explorer" mapped to \Dora\ and "Go, Diego, Go!" mapped to \Diego\ would that look like:
def folderMap = ["Dora The Explorer":"Dora", "Go, Digeo, Go!": "Diego"]

Where would the new folder names be stored? In a string variable called folderMap?

Is this something I would find in a groovy doc somewhere? (Sorry I haven't done much programming in a while - my Eng degree in the mid 80s was during the Fortran 77 era!)

Do you have a link to the Groovy distro with the GUI editor that you showed, even if it can't be used perfectly for SJQ?
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #200  
Old 12-30-2010, 02:14 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by wayner View Post
That looks useful since I have no idea how to use groovy so it is nice to try out scripts of the "Hello World" type.

How exactly to Hashmaps work? Let's say I have "Dora The Explorer" mapped to \Dora\ and "Go, Diego, Go!" mapped to \Diego\ would that look like:
def folderMap = ["Dora The Explorer":"Dora", "Go, Digeo, Go!": "Diego"]

Where would the new folder names be stored? In a string variable called folderMap?
Let's assume you've defined the hashmap above and you've already got the media file in a var name mf...

Code:
String title = MediaFileAPI.GetMediaTitle(mf)
String folderName = folderMap[title]
File folder = new File(folderName)
// Then use the folder var in your call to AddTranscodeJob(); of course you'll want to check that folderName isn't null (i.e. the title wasn't defined in the hashmap, etc.), I don't show the error checking in this example.
Quote:
Is this something I would find in a groovy doc somewhere? (Sorry I haven't done much programming in a while - my Eng degree in the mid 80s was during the Fortran 77 era!)
Yes, though the organization and depth of the groovy docs are questionable. With a little bit of effort, I've been able to find everything I need. I hadn't even heard of groovy until I started researching Java scripting languages for SJQv4. Since the syntax is so similar to Java, I've found it rather easy to pick up, despite the shaky docs.

User Guide: http://groovy.codehaus.org/User+Guide

Quote:
Do you have a link to the Groovy distro with the GUI editor that you showed, even if it can't be used perfectly for SJQ?
Download Groovy distros from here: http://groovy.codehaus.org/Download

SJQ uses 1.7.5, looks like 1.7.6 is now available; either should be fine.

This doc explains how to invoke the GUI editor: http://groovy.codehaus.org/Groovy+Console

Remember, scripts that run in SJQ that use the various SJQ/Sage API global vars won't run in this env; they'll fail with undefined var errors, etc. But it's a good place to muck around with basic groovy scripts, etc.
__________________
Twitter: @ddb_db
Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive
Capture: 2 x Colossus
STB Controller: 1 x USB-UIRT
Software:Java 1.7.0_71; SageTV 7.1.9
Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter
Plugins: Too many to list now...
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Plugin: MizookLCD (Alternate SageTV LCDSmartie Plugin) cslatt SageTV Customizations 48 06-11-2012 10:44 AM
SJQv4: Technology Preview Slugger SageTV v7 Customizations 39 12-17-2010 01:17 PM
SageTV Plugin Developers: Any way to see stats for your plugin? mkanet SageTV Software 4 12-12-2010 10:33 PM
MediaPlayer Plugin/STV Import: Winamp Media Player Plugin deria SageTV Customizations 447 12-11-2010 07:38 PM
SJQv4: Design Discussion Slugger SageTV v7 Customizations 26 10-18-2010 08:22 AM


All times are GMT -6. The time now is 07:11 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.