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
  #1241  
Old 10-21-2012, 09:21 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
It looks great - I love the animated dropdown menus, and it is great to be able to get SJQ info via the web. How do I inject my own menu items?
__________________
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
  #1242  
Old 10-21-2012, 10:33 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
I updated SJQ and now I have a script failing from SJQ - however this script runs fine from the SageGroovyConsole. Perhaps something in the new version of Groovy is causing the problem as I assume that the SageGroovyConsole has not been updated.The script attempts to send an email with today's recordings. Here is the error:
Code:
===== Mon Oct 22 00:25:26 EDT 2012 =====

LOG4J: Configured Logging for: sagex-api using file: sagex-api.log4j.properties
----- error  -----

javax.script.ScriptException: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
Script1.groovy: 27: The class 'EmailSettings' has an incorrect modifier private.
 @ line 27, column 1.
   private class EmailSettings {
   ^

1 error

	at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:138)
	at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:124)
	at com.google.code.sagetvaddons.sjq.agent.ScriptRunner.exec(ScriptRunner.java:114)
	at com.google.code.sagetvaddons.sjq.agent.ScriptRunner.main(ScriptRunner.java:175)
Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
Script1.groovy: 27: The class 'EmailSettings' has an incorrect modifier private.
 @ line 27, column 1.
   private class EmailSettings {
   ^

1 error

	at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:309)
	at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1054)
	at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:564)
	at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:542)
	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:519)
	at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:279)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:258)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:244)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:202)
	at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.getScriptClass(GroovyScriptEngineImpl.java:354)
	at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:130)
	... 3 more
------------------




==============================
The relevant code in my script looks like this (I probably stole this from one of your scripts):
Code:
private class EmailSettings {
    static def sendMail = true                  // Set this to false to just dump the alert msg to stdout instead of emailing it
    static def host = 'smtp.gmail.com'
    static def user = 'wayner@gmail.com'
    static def pwd  = '****'
    static def port = '465'
    static def subj = 'Sage Recordings for Today'
    static def from = user                       // Gmail will reject mail via SMTP if the from addr != user id so no point in changing this
    static def to   = 'wayner@gmail.com'           // Sometimes Gmail won't send an email addressed to yourself, try a plus address at the end; YMMV
    static def ssl  = 'true'                     // Gmail requires SSL, other SMTP servers may or may not; this is a STRING setting!

}

def sendMail(def msg) {
   def ant = new AntBuilder()
   ant.mail(mailhost: EmailSettings.host, mailport: EmailSettings.port, subject: EmailSettings.subj, user: EmailSettings.user, password: EmailSettings.pwd, ssl: "true") {
       from(address: EmailSettings.from)
       to(address: EmailSettings.to)
       message(msg)   
   }
}
__________________
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
  #1243  
Old 10-22-2012, 06:06 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by wayner View Post
I updated SJQ and now I have a script failing from SJQ - however this script runs fine from the SageGroovyConsole. Perhaps something in the new version of Groovy is causing the problem as I assume that the SageGroovyConsole has not been updated.
Yup, I touched on this a few posts back, but Groovy 2.0 does not allow the use of private fields, methods, nor classes in top level scripts. The fix is as simple as removing the private key word from the class definition.
__________________
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
  #1244  
Old 10-22-2012, 06:28 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by wayner View Post
It looks great - I love the animated dropdown menus, and it is great to be able to get SJQ info via the web. How do I inject my own menu items?
Details on how to inject additional items can be found here:

https://code.google.com/p/sagetv-add...sIntoWebUIMenu

Beware of the bug I describe at the bottom of that page. Just discovered that now while writing that doc. Basically, only injections of new top level menus currently works, the mechanism described to inject items into existing menus does not work. I'm in no hurry to go fixing that bug unless enough people express the desire to actually use the functionality.
__________________
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
  #1245  
Old 10-22-2012, 06:43 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
A new build of SageGroovy has been uploaded to Google Code that upgrades Groovy to 2.0.5.
__________________
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
  #1246  
Old 10-22-2012, 07:45 AM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
I know we are getting into a lot of Sage Web server discussion in the SJQ thread, but one thing that should really be added to the Sage Web home page is the Java Heap status - there is a bunch of other status type of info but for some reason this is missing.
__________________
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
  #1247  
Old 10-22-2012, 07:46 AM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
Quote:
Originally Posted by Slugger View Post
Details on how to inject additional items can be found here:
Great, thanks Slugger. If users come up with a bunch of useful additional items would it be possible to bundle these into the core product? Two things that I would like to add to the system are the ability to restart the SageTVService, and a Client/Extender status report.
__________________
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
  #1248  
Old 10-22-2012, 07:51 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by wayner View Post
I know we are getting into a lot of Sage Web server discussion in the SJQ thread, but one thing that should really be added to the Sage Web home page is the Java Heap status - there is a bunch of other status type of info but for some reason this is missing.
I happily accept patches. Provide a patch and I'll happily build it and upload it to the repository.

Quote:
Originally Posted by wayner View Post
Great, thanks Slugger. If users come up with a bunch of useful additional items would it be possible to bundle these into the core product? Two things that I would like to add to the system are the ability to restart the SageTVService, and a Client/Extender status report.
Sure. But there's nothing stopping you from simply creating a new plugin whose only file is the web.menu file to be injected into the menu. But I'd also accept a patch that updates the base menu as well.

And now we are way off topic here, please take any follow ups from this over to the web UI thread. Thanks.
__________________
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
  #1249  
Old 10-22-2012, 01:27 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
To get back to SJQ - would it be possible to add other events that would trigger SJQ tasks. Items like Client/Context connected/disconnected, SageTV service start, etc. The SageAlert list of Events would even be a good starting point.

I guess I could trigger a Process Executor from SageAlert that kicks off a Groovy script, but it would likely be cleaner to do everything within 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
  #1250  
Old 10-22-2012, 01:30 PM
razrsharpe razrsharpe is offline
Sage Icon
 
Join Date: Sep 2008
Location: Boston, MA
Posts: 2,111
Quote:
Originally Posted by wayner View Post
For example it would be nice to at least provide a link in the web server menus to the SJQ groovy page that allows you to manage SJQ via the web server.
Quote:
Originally Posted by Slugger View Post
An SJQ Web UI update should be in the repo shortly that injects the SJQ menu into the web UI.
When did SJQ v4 get a web ui? and what can be done with it? I tried searching for some info about it but couldn't find anything. (If i missed where that is can someone point me in the right direction? )

One of the major things still preventing me from upgrading to SJQ v4 is the lack of a web ui... Sounds like i might need to carve out an evening or 2 to upgrade...
__________________
Server 2003 r2 32bit, SageTV9 (finally!)
2x Dual HDHR (OTA), 1x HD-PVR (Comcast), 1x HDHR-3CC via SageDCT (Comcast)
2x HD300, 1x SageClient (Win10 Test/Development)
Check out TVExplorer
Reply With Quote
  #1251  
Old 10-22-2012, 01:42 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
I imagine Slugger will chime in on this, but here is my recollection...

About a year or more ago Slugger added the capability to use Groovy scripts to develop your own Sage web pages. I believe he did this to facilitate addin a web UI to SJQv4, amont other things, and he created the SJQ code for it at that time but it was kind of undocumented and hidden away although if you knew the path you could get to it. Due to the declining interest in Sage, and his lack of time he kind of stepped back from enhancing these plugins.

You can use it to browse the Queue, browse clients, enter all of the arguments for a task, I think pretty much everything you could do in the previous versions of SJQ. And now you can write tasks that can be linked to web pages - like just hitting a web page to cause a restart of your Sage service.
__________________
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; 10-22-2012 at 01:58 PM.
Reply With Quote
  #1252  
Old 10-22-2012, 02:26 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by wayner View Post
To get back to SJQ - would it be possible to add other events that would trigger SJQ tasks. Items like Client/Context connected/disconnected, SageTV service start, etc. The SageAlert list of Events would even be a good starting point.
SA event list is a good starting point? The SA event list is basically every Sage event. lol!! (Might be missing a couple.)

Is it possible? Yes. Is it likely... hmmmmm... probably not. There is only exactly one plugin that I'm actively developing: Schedules Direct EPG plugin. Everything else is maintenance only, and by "maintenance" I basically mean dormant. Features like this basically would only happen if I wanted/needed it in my environment. This, unfortunately, doesn't qualify.

The various updates and builds of other things over the weekend only happened because I need/want to upgrade to Groovy 2.0 for the EPG plugin. The initial web server build was a necessity to fix the Groovy support in the web ui that Groovy 2.0 would have broken with no update. The other couple builds were a bonus because I already had the code open, wanted the plugin manager fix and since you asked nicely I threw in the new menu as well (which, I'll admit, is also something I certainly didn't mind having). Even that didn't get released bug free (can't inject into existing menus as planned). But I have no desire to do another build just to fix that - until I actually want to inject into existing menus (or there's an overwhelming cry from the masses to fix it).

Quote:
I guess I could trigger a Process Executor from SageAlert that kicks off a Groovy script, but it would likely be cleaner to do everything within SJQ.
And that Groovy script could then inject tasks into your SJQ queue. A really small groovy script is all you'd need to simply throw an arbitrary task into the SJQ task queue. You can then do all the heavy lifting via SJQ once you get that task in there. If I really wanted to trigger SJQ tasks on unsupported events and I didn't own the code, this is how I'd do it.

And, as always, I gladly accept and will build user supplied patches.
__________________
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
  #1253  
Old 10-22-2012, 02:29 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by razrsharpe View Post
When did SJQ v4 get a web ui? and what can be done with it? I tried searching for some info about it but couldn't find anything. (If i missed where that is can someone point me in the right direction? )

One of the major things still preventing me from upgrading to SJQ v4 is the lack of a web ui... Sounds like i might need to carve out an evening or 2 to upgrade...
Quote:
Originally Posted by wayner View Post
I imagine Slugger will chime in on this, but here is my recollection...

About a year or more ago Slugger added the capability to use Groovy scripts to develop your own Sage web pages. I believe he did this to facilitate addin a web UI to SJQv4, amont other things, and he created the SJQ code for it at that time but it was kind of undocumented and hidden away although if you knew the path you could get to it. Due to the declining interest in Sage, and his lack of time he kind of stepped back from enhancing these plugins.

You can use it to browse the Queue, browse clients, enter all of the arguments for a task, I think pretty much everything you could do in the previous versions of SJQ. And now you can write tasks that can be linked to web pages - like just hitting a web page to cause a restart of your Sage service.
Pretty much what Wayne said. I wrote the web UI support back in January, I announced it somewhere in here, but didn't make a huge deal out of it. A hundred or so people seemed to download it and I haven't heard a peep about it since so I guess it works? It's fairly functional... it's certainly more than sufficient to do most common tasks for SJQ from the web UI. It also allows viewing of the queue from the web. With all that said, I hope the theme of all of these posts are clear: use it, love it, enjoy it, but realize there are zero planned updates to what's there. But I do accept and will gladly build user supplied patches.
__________________
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
  #1254  
Old 10-22-2012, 03:01 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
Quote:
Originally Posted by Slugger View Post
And that Groovy script could then inject tasks into your SJQ queue. A really small groovy script is all you'd need to simply throw an arbitrary task into the SJQ task queue. You can then do all the heavy lifting via SJQ once you get that task in there. If I really wanted to trigger SJQ tasks on unsupported events and I didn't own the code, this is how I'd do it.
Great - sorry to be such a nag, but thanks for all of the work that you have done for the Sage user community.

Your plugins have made Sage hugely more useful and I use them all on a many times per day basis. I get Tweets and emails from SageAlert several times per day, SJQ processes all of my recordings, I get a daily email listing my recordings that uses Groovy and I use the Sage Web Server all the time.

And if and when hockey ever starts up again I will get to use the most brilliant of all, SRE.
__________________
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
  #1255  
Old 11-13-2012, 08:09 AM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
My system just just filled up due to lobs.db entries. Do these come from SJQ or another plugin.

The logs were filled with this:

Code:
===== Wed Nov 07 21:37:20 EST 2012 =====

LOG4J: Configured Logging for: sagex-api using file: sagex-api.log4j.properties
----- stdout -----

ERROR: Invalid environment data passed to scritpt!
------------------
__________________
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
  #1256  
Old 11-13-2012, 08:19 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Yeah... likely a job was added to the queue and the media file for that object was deleted or somehow invalidated and the job got caught in an infinite loop of running, being sent back to the queue, retrying, back to the queue, retrying, etc. This issue was fixed long ago, but it seems you've found another code path to the issue.

The fix: Inspect your SJQ job queue and remove either 1) everything or 2) if you can spot the culprit then just remove that job. You'll also want to cleanup the H2 lobs cache.

Unfortunately, unless you can pin point exactly what's causing it (and ideally reproduce it), I don't plan on investigating too deeply at this point (re: project EOL) unless you get lucky enough and I encounter the same issue in my environment at some point. In that case, I'm likely to dig deep into it and try to fix it.

But the cause and fix I outline above is your next plan of attack.
__________________
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
  #1257  
Old 11-13-2012, 08:26 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by Slugger View Post
The fix: Inspect your SJQ job queue and remove either 1) everything or 2) if you can spot the culprit then just remove that job. You'll also want to cleanup the H2 lobs cache.
By everything, I meant all active, incomplete tasks (taks in WAITING or RUNNING state).
__________________
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
  #1258  
Old 11-13-2012, 09:07 AM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
There was nothing WAITING or RUNNING but I did delete all FAILED tasks. I then restarted the SageTV service. I will keep an eye on it to see what happens now.
__________________
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
  #1259  
Old 11-14-2012, 07:15 PM
Skirge01's Avatar
Skirge01 Skirge01 is offline
SageTVaholic
 
Join Date: Jun 2007
Location: New Jersey
Posts: 2,599
I'm trying to get comskip working with SJQ4 now and, thanks to Slugger's help with code repurposed from (I think) wayner. I'm using the SJQ service so that I understand everything going on in the UI and because it's what I was using with SJQ3. Anyhow, I want to see if I understood the guide correctly.

This is from the guide:
Code:
task.mytask.exe=C:/bin/mytask.exe
# task.mytask.args=/f /g /t
task.mytask.test=C:/scripts/mytask_precheck.groovy
# task.mytask.testargs=
# task.mytask.schedule=* * * * *
# task.mytask.resources=100
# task.mytask.maxprocs=1
# task.mytask.rcmin=0
# task.mytask.rcmax=0
Am I correct in thinking that I need it to say this:
Code:
task.mytask.exe=C:/comskip/comskip.exe
# task.mytask.args=/f /g /t
task.mytask.test=C:/scripts/comskip.groovy
# task.mytask.testargs=
# task.mytask.schedule=* * * * *
task.mytask.resources=33
task.mytask.maxprocs=3
# task.mytask.rcmin=0
# task.mytask.rcmax=0
...with comskip.groovy being the aforementioned code I repurposed?

Also, with how I have the resources set, is setting the maxprocs redundant? Well, I guess it wouldn't be if I had a task which required only 1 resource, right? I think I'm starting to understand this.

Is that everything? Is the only other step to register the task client and then assign the task to each of my favorites? Ouch... that's going to take some time with nearly 100 of them... LOL! Maybe I'll find something else in the guide that says there's an easier way.
__________________
Server: XP, SuperMicro X9SAE-V, i7 3770T, Thermalright Archon SB-E, 32GB Corsair DDR3, 2 x IBM M1015, Corsair HX1000W PSU, CoolerMaster CM Storm Stryker case
Storage: 2 x Addonics 5-in-3 3.5" bays, 1 x Addonics 4-in-1 2.5" bay, 24TB
Client: Windows 7 64-bit, Foxconn G9657MA-8EKRS2H, Core2Duo E6600, Zalman CNPS7500, 2GB Corsair, 320GB, HIS ATI 4650, Antec Fusion
Tuners: 2 x HD-PVR (HTTP tuning), 2 x HDHR, USB-UIRT
Software: SageTV 7
Reply With Quote
  #1260  
Old 11-14-2012, 07:47 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by Skirge01 View Post
I'm trying to get comskip working with SJQ4 now and, thanks to Slugger's help with code repurposed from (I think) wayner. I'm using the SJQ service so that I understand everything going on in the UI and because it's what I was using with SJQ3. Anyhow, I want to see if I understood the guide correctly.

This is from the guide:
Code:
task.mytask.exe=C:/bin/mytask.exe
# task.mytask.args=/f /g /t
task.mytask.test=C:/scripts/mytask_precheck.groovy
# task.mytask.testargs=
# task.mytask.schedule=* * * * *
# task.mytask.resources=100
# task.mytask.maxprocs=1
# task.mytask.rcmin=0
# task.mytask.rcmax=0
Am I correct in thinking that I need it to say this:
Code:
task.mytask.exe=C:/comskip/comskip.exe
# task.mytask.args=/f /g /t
task.mytask.test=C:/scripts/comskip.groovy
# task.mytask.testargs=
# task.mytask.schedule=* * * * *
task.mytask.resources=33
task.mytask.maxprocs=3
# task.mytask.rcmin=0
# task.mytask.rcmax=0
...with comskip.groovy being the aforementioned code I repurposed?
This looks about right to me.

Quote:
Also, with how I have the resources set, is setting the maxprocs redundant? Well, I guess it wouldn't be if I had a task which required only 1 resource, right? I think I'm starting to understand this.
Depends. It's kind of redundant, but using both lets you do different things. Let's say you only want to ever run 1 comskip at once, but you want to also run other tasks while that one comskip is running. In such a case, you might set resources for comskip to 50, but maxprocs to 1. This way no more than 1 comskip will ever run at once (on this client), but you also keep 50 resources free for other tasks that may come up while that comskip is running.

Quote:
Is that everything? Is the only other step to register the task client and then assign the task to each of my favorites? Ouch... that's going to take some time with nearly 100 of them... LOL! Maybe I'll find something else in the guide that says there's an easier way.

What would I do? I'd write a groovy script that assigns the tasks to my favs in bulk and get SJQ to run it for me. (Actually, I'd do it slightly different, but since you've got SJQ setup, this is probably the easiest route to take.)

Quick, off the cuff example (which may not exactly work, I didn't test it, but should show you what you're trying to do).

Code:
// Attach the 'COMSKIP' task to every fav I have
FavoriteAPI.GetFavorites().each {
   FavoriteAPI.SetFavoriteProperty(it, 'SJQ4_RecordingStopped', 'COMSKIP')
}
That sure beats clicking thru each fav and editing it? Save the above as a .groovy file and then configure a task in your task client to run it then queue the task to execute it just once.

Of course, you probably want to only apply comskip to certain favs -- ones not recording from HBO, etc. It wouldn't be much fun if I wrote everything, so I leave that as an exercise for the reader.

Happy scripting...
__________________
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.