SageTV Community  

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

Notices

SageTV Customizations This forums is for discussing and sharing user-created modifications for the SageTV application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss customizations for SageTV version 6 and earlier, or for the SageTV3 UI.

Closed Thread
 
Thread Tools Search this Thread Display Modes
  #941  
Old 10-19-2009, 01:44 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by mguebert View Post
I have been able to get SJQ running fine, and have a ruleset that is setting up jobs to run. I am on SJQ ver 2.1.5.542.

I have tried to install the standalone client with 127.0.0.1, \\server, and localhost and I get the following output from the command line

SJQ Task Client v2.1.5.556
Using 'C:/sjqc' as location for configuration file...
Exception in thread "main" java.lang.RuntimeException: java.io.FileNotFoundExcep
tion: http://localhost:80/sjq/SJQ?proto=2&cmd=writeLog
at com.google.code.sagetvaddons.sjqc.TaskClient.log(Unknown Source)
at com.google.code.sagetvaddons.sjqc.TaskClient.log(Unknown Source)
at com.google.code.sagetvaddons.sjqc.TaskClient.pop(Unknown Source)
at com.google.code.sagetvaddons.sjqc.TaskClient.run(Unknown Source)
at com.google.code.sagetvaddons.sjqc.TaskClient.main(Unknown Source)
Caused by: java.io.FileNotFoundException: http://localhost:80/sjq/SJQ?proto=2&cm
d=writeLog
at sun.net.http://www.protocol.http.HttpURLConn...Stream(Unknown So
urce)
... 5 more


I have also tried the service and get the same results, here is the output from the wrapper.log

STATUS | wrapper | 2009/10/18 17:13:14 |
STATUS | wrapper | 2009/10/18 17:13:14 | Launching a JVM...
INFO | jvm 1 | 2009/10/18 17:13:14 | WrapperManager: Initializing...
INFO | jvm 1 | 2009/10/18 17:13:15 | SJQ Task Client v2.1.5.556
INFO | jvm 1 | 2009/10/18 17:13:15 | Using 'C:/sjqc' as location for configuration file...
INFO | jvm 1 | 2009/10/18 17:13:15 | WrapperSimpleApp:
INFO | jvm 1 | 2009/10/18 17:13:15 | WrapperSimpleApp: Encountered an error running main:
INFO | jvm 1 | 2009/10/18 17:13:15 | WrapperSimpleApp: java.lang.RuntimeException: java.io.FileNotFoundException: http://127.0.0.1:80/sjq/SJQ?proto=2&cmd=writeLog
INFO | jvm 1 | 2009/10/18 17:13:15 | WrapperSimpleApp: at com.google.code.sagetvaddons.sjqc.TaskClient.log(Unknown Source)
INFO | jvm 1 | 2009/10/18 17:13:15 | WrapperSimpleApp: at com.google.code.sagetvaddons.sjqc.TaskClient.log(Unknown Source)
INFO | jvm 1 | 2009/10/18 17:13:15 | WrapperSimpleApp: at com.google.code.sagetvaddons.sjqc.TaskClient.pop(Unknown Source)
INFO | jvm 1 | 2009/10/18 17:13:15 | WrapperSimpleApp: at com.google.code.sagetvaddons.sjqc.TaskClient.run(Unknown Source)
INFO | jvm 1 | 2009/10/18 17:13:15 | WrapperSimpleApp: at com.google.code.sagetvaddons.sjqc.TaskClient.main(Unknown Source)
INFO | jvm 1 | 2009/10/18 17:13:15 | WrapperSimpleApp: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO | jvm 1 | 2009/10/18 17:13:15 | WrapperSimpleApp: at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
INFO | jvm 1 | 2009/10/18 17:13:15 | WrapperSimpleApp: at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
INFO | jvm 1 | 2009/10/18 17:13:15 | WrapperSimpleApp: at java.lang.reflect.Method.invoke(Unknown Source)
INFO | jvm 1 | 2009/10/18 17:13:15 | WrapperSimpleApp: at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:236)
INFO | jvm 1 | 2009/10/18 17:13:15 | WrapperSimpleApp: at java.lang.Thread.run(Unknown Source)
INFO | jvm 1 | 2009/10/18 17:13:15 | WrapperSimpleApp: Caused by: java.io.FileNotFoundException: http://127.0.0.1:80/sjq/SJQ?proto=2&cmd=writeLog
INFO | jvm 1 | 2009/10/18 17:13:15 | WrapperSimpleApp: at sun.net.http://www.protocol.http.HttpURLConn...Stream(Unknown Source)
INFO | jvm 1 | 2009/10/18 17:13:15 | WrapperSimpleApp: ... 11 more
STATUS | wrapper | 2009/10/18 17:13:17 | <-- Wrapper Stopped

I have Java ver 6 update 15 installed


Can anyone help me get the client working?
Are you sure your Jetty server is running on port 80? By default, it isn't. What port do you connect to the web UI on? Whatever port that is, make sure the task client is using the same port by editing the properties file (see User Guide for details on how to make those changes).
__________________
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...
  #942  
Old 10-19-2009, 01:49 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by btrcp2000 View Post
Despite the presence of these in my ini:

output_default=0
output_edl=1

comskip will not output edl files when triggered by SJQ. It will do it if I manually drag and drop files.

Here is my sjq settings file if it helps:
:MAXPROCS 3
COMSKIP {
:MAX 3
:CPU "NORMAL"
:RETURNCODE 1
"C:/Program Files/SageTV/SageTV/comskip/comskip.exe \"%c%\""
}
Add the path to your ini file in the command line:

"C:/Program Files/SageTV/SageTV/comskip/comskip.exe \"--ini=C:\\Program Files\\SageTV\\SageTV\\comskip\\comskip.ini\" \"%c%\""

** Make sure the ini file is actually in that dir and it's named correctly.
__________________
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...
  #943  
Old 10-19-2009, 06:49 AM
mguebert mguebert is offline
Sage Advanced User
 
Join Date: Jan 2007
Posts: 152
Quote:
Originally Posted by Slugger View Post
Add the path to your ini file in the command line:

"C:/Program Files/SageTV/SageTV/comskip/comskip.exe \"--ini=C:\\Program Files\\SageTV\\SageTV\\comskip\\comskip.ini\" \"%c%\""

** Make sure the ini file is actually in that dir and it's named correctly.
Thanks, that was it. I am not sure why I thought the port had to be different from the Jetty server. But anyway thanks a bunch. I look forward to getting this running. I have been having issues using dirmon and the service stopping.
  #944  
Old 10-19-2009, 07:01 AM
personalt's Avatar
personalt personalt is offline
Sage Advanced User
 
Join Date: Apr 2008
Posts: 243
I have been successful at using SJQ to run comskip. I now want to have it run some transcoding of some of my shows so I can watch them on my phone during my train ride in.

I set up a rule using the TRANSCODEOPS setting. The rule works fine and adds the right shows the queue.

It appears you can use use sages internal transcoder based on the fact that the quality levels in TRANSCODEOPS come from sage.

My question was, what do I need to put in my client settings? What batch file do I need to call?
  #945  
Old 10-19-2009, 10:48 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by personalt View Post
I have been successful at using SJQ to run comskip. I now want to have it run some transcoding of some of my shows so I can watch them on my phone during my train ride in.

I set up a rule using the TRANSCODEOPS setting. The rule works fine and adds the right shows the queue.

It appears you can use use sages internal transcoder based on the fact that the quality levels in TRANSCODEOPS come from sage.

My question was, what do I need to put in my client settings? What batch file do I need to call?
Just call the internal task _TRANSCODE. There is an internal thread that runs and processes these special task names. As long as your TRANSCODEOPTS (you're missing a T) are setup correctly, SJQ will automatically add the jobs to the Sage transcode queue. If you want to use an external transcoder then you'll have to setup batch files/etc. as you normally would.
__________________
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...
  #946  
Old 10-21-2009, 08:29 PM
gveres gveres is offline
Sage Aficionado
 
Join Date: Nov 2007
Location: Waterloo, Ontario
Posts: 404
Need some assistance....

I am a long time SJQ v1 user and since I am building a new PVR machine, I am moving over to SJQ v2. I have the server side of it running properly, well with a couple example rules.

But when I try to install the client (the nt service client) I get a java exception every time when i start it up.

Here is what I did:
1) I downloaded sjqc-ntsvc-2.1.5.556.zip and unzipped it to c:\sjqc
2) I created the sjq.properties files (actually it was overwritten when I ran the sjqc.bat file) Here is the contents:
Code:
#Auto generated by SJQC
#Wed Oct 21 22:16:31 EDT 2009
port=8080
host=localhost
is_ssl=false
3) I ran c:\sjqc\bin\sjqc.bat and I get this in the log file:

Code:
STATUS | wrapper  | 2009/10/21 22:16:31 | --> Wrapper Started as Console
STATUS | wrapper  | 2009/10/21 22:16:31 | Java Service Wrapper Community Edition 3.3.1
STATUS | wrapper  | 2009/10/21 22:16:31 |   Copyright (C) 1999-2008 Tanuki Software, Inc.  All Rights Reserved.
STATUS | wrapper  | 2009/10/21 22:16:31 |     http://wrapper.tanukisoftware.org
STATUS | wrapper  | 2009/10/21 22:16:31 | 
STATUS | wrapper  | 2009/10/21 22:16:31 | Launching a JVM...
INFO   | jvm 1    | 2009/10/21 22:16:31 | WrapperManager: Initializing...
INFO   | jvm 1    | 2009/10/21 22:16:31 | SJQ Task Client v2.1.5.556
INFO   | jvm 1    | 2009/10/21 22:16:31 | Using 'C:/sjqc' as location for configuration file...
INFO   | jvm 1    | 2009/10/21 22:16:31 | WrapperSimpleApp: 
INFO   | jvm 1    | 2009/10/21 22:16:31 | WrapperSimpleApp: Encountered an error running main:
INFO   | jvm 1    | 2009/10/21 22:16:31 | WrapperSimpleApp: java.lang.RuntimeException: java.io.IOException: Server returned HTTP response code: 403 for URL: http://localhost:8080/sjq/SJQ?proto=2&cmd=writeLog
INFO   | jvm 1    | 2009/10/21 22:16:31 | WrapperSimpleApp: 	at com.google.code.sagetvaddons.sjqc.TaskClient.log(Unknown Source)
INFO   | jvm 1    | 2009/10/21 22:16:31 | WrapperSimpleApp: 	at com.google.code.sagetvaddons.sjqc.TaskClient.log(Unknown Source)
INFO   | jvm 1    | 2009/10/21 22:16:31 | WrapperSimpleApp: 	at com.google.code.sagetvaddons.sjqc.TaskClient.pop(Unknown Source)
INFO   | jvm 1    | 2009/10/21 22:16:31 | WrapperSimpleApp: 	at com.google.code.sagetvaddons.sjqc.TaskClient.run(Unknown Source)
INFO   | jvm 1    | 2009/10/21 22:16:31 | WrapperSimpleApp: 	at com.google.code.sagetvaddons.sjqc.TaskClient.main(Unknown Source)
INFO   | jvm 1    | 2009/10/21 22:16:31 | WrapperSimpleApp: 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO   | jvm 1    | 2009/10/21 22:16:31 | WrapperSimpleApp: 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
INFO   | jvm 1    | 2009/10/21 22:16:31 | WrapperSimpleApp: 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
INFO   | jvm 1    | 2009/10/21 22:16:31 | WrapperSimpleApp: 	at java.lang.reflect.Method.invoke(Unknown Source)
INFO   | jvm 1    | 2009/10/21 22:16:31 | WrapperSimpleApp: 	at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:236)
INFO   | jvm 1    | 2009/10/21 22:16:31 | WrapperSimpleApp: 	at java.lang.Thread.run(Unknown Source)
INFO   | jvm 1    | 2009/10/21 22:16:31 | WrapperSimpleApp: Caused by: java.io.IOException: Server returned HTTP response code: 403 for URL: http://localhost:8080/sjq/SJQ?proto=2&cmd=writeLog
INFO   | jvm 1    | 2009/10/21 22:16:31 | WrapperSimpleApp: 	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
INFO   | jvm 1    | 2009/10/21 22:16:31 | WrapperSimpleApp: 	... 11 more
STATUS | wrapper  | 2009/10/21 22:16:33 | <-- Wrapper Stopped
It seems to be trying to connect to the server and the server is giving back a 403 - not authorized. I don't see anywhere that I can specify the server password that was setup when installing the server.

It is trying to connect to:

if I put this in a browser I get the same 403 response. If I pull off the arguments and put this in the browser I get to the SJQ server pages:

If I change localhost to the IP addr of the machine I get the following 500 error message:

Code:
HTTP ERROR 500
Problem accessing /sjq/SJQ. Reason: 

    INTERNAL_SERVER_ERROR

Caused by:
java.lang.NullPointerException
	at com.google.code.sagetvaddons.sjq.server.SJQServlet.doPost(SJQServlet.java:216)
	at com.google.code.sagetvaddons.sjq.server.SJQServlet.doGet(SJQServlet.java:92)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:389)
	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417)
	at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
	at org.mortbay.jetty.handler.rewrite.RewriteHandler.handle(RewriteHandler.java:230)
	at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
	at org.mortbay.jetty.Server.handle(Server.java:326)
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
	at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:864)
	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:539)
	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520)


--------------------------------------------------------------------------------
Powered by Jetty://
Any suggestions?

BTW, excellent user guide!

Thanks
Greg

Last edited by gveres; 10-21-2009 at 08:34 PM.
  #947  
Old 10-21-2009, 09:12 PM
WhiteWhisker WhiteWhisker is offline
Sage User
 
Join Date: Nov 2008
Posts: 16
Quote:
Originally Posted by Slugger View Post
This is a request for feedback. I've implemented an initial version of the new SJQ v3 test and command syntax. Before I pat myself on the back, I'm going to explain what I've done and solicit some feedback on it.

The quick overview: Basically, I'm removing most of the tests in SJQ and replacing them with (limited) direct access to the underlying object being processed by SJQ. This accomplishes two key things:
  • Allow immediate access to new tests without the need to manually add the test and rebuild SJQ
  • Provides a general mechanism that is the basis for the addition of new object types that can be scanned by SJQ
Basically, I've introduced this new object called '$' that you will use in your tests to test against object specific info. The same '$' object can also be used in your command lines to easily allow the passing of any^ type of data to your command lines.

^ Only access to methods that are named Is*, Get*, and Has* is permitted and the return value of these methods must be a boolean, String or number; any other type is converted to a String via the object's toString() method.

So, here's a basic ruleset from SJQ v2.x:

Code:
if [IsTV == true && IsActivelyRecording == false && IsWatched == false && FileExists != "%d%/%p%.edl" && Filename =$ ".mpg"] {
  COMSKIP
}
Now, in SJQ v3 your ruleset will look like this:

Code:
if [$.IsTVFile{} == true && $.IsFileCurrentlyRecording{} == false && $.IsWatchedCompletely{} == false && FileExists != "%d%/%p%.edl" && Filename =$ ".mpg"] {
  COMSKIP
}
Some SJQ tests will remain like FileExists, Filename, DayOfWeek, etc. (all tests that aren't really related to the actual object being processed). But if data can be queried from the object itself then that's where you should be getting it now. And the object being queried is referred to as '$' in SJQ. Where am I pulling these method names from? Directly from the SageAPI (via gkusnick's API wrapper). All the tests that you call on an object can be had right from the SageAPI docs. However, as stated above, only a subset of the object methods are available to be called. Namely, only those methods that return data and must be named Get*, Has* or Is*. When dealing with media files, the '$' object knows about all methods for the media file object, it's associated Airing object, Show object, and Channel object. You can call any of the methods from those APIs and they will be processed by SJQ.

On the client task side, nothing has changed except that the $ object is available for use in your command lines and some of the media variables (ones related to providing info about the media file like title, subtitle, etc.) have been removed since the info is now available via the $ object.

So for the comskip example, you probably don't need to change anything:

Code:
COMSKIP {
   "C:/comskip/comskip.exe \"%c%\""
}
But if you were running commands and passing the media's title to the command line like this:

Code:
SOMECMD {
   "C:/tools/mytool.exe \"%t%\""
}
Then you would now do it like this (because the %t% media variable has been removed):

Code:
SOMECMD {
   "C:/tools/mytool.exe \"$.GetShowTitle{}\""
}
This allows you do insert any kind of data about the media file into your command line (as long as that data is available via an API call). You can now pass custom metadata like this:

Code:
MYCMD {
   "C:/tools/mytools.exe \"$.GetMediaFileMetadata{my_custom_field}\""
}
I'm looking for thoughts on what I've done. Is there something missing? Some way to make it easier? Ultimately, you're going to be able to process System message objects via SJQ as well (and have full access to the SysMsg object via '$' in SJQ). So you could write a rule that resets a device when a system message tells you it's broken (this example is theoretical, I haven't even started on introducing new object types into SJQ yet, but this is what I'm expecting to happen):

Code:
// Must determine what type of object you're scanning first before calling API calls with $
if [IsSystemMessage == true && $.GetSystemMessageLevel{} == 3 && $.GetSystemMessageString{} =* "HD-PVR"] {
   RESETHDPVR
}
So this test processes a system message and if it's an error message and it's about the HDPVR then queue up a "RESETHDPVR" task. Then your task client will call a bat file or whatever to reset your HDPVR. Again, this system message business is theoretical, but it's in the plans so I'd welcome feedback on this idea as well. Everything I've discussed is working and I'm running it as my current SJQ install except for the system message stuff so it's close to coming, however, not too close as I have some cleanup to do and some heavy testing. Probably a few weeks before any builds become available on Google Code.
I am about to embark on this exact task (HDPVR reset), I posted a thread here talking about what I want to do and somebody pointed out your v3 version might do this, then I read this post etc: http://forums.sagetv.com/forums/showthread.php?p=387866

Your new V3 stuff looks great, I am in the process right now of moving my V2 rules over to the new system but I might as well upgrade to V3 betas...

So basically what I am trying to do is figure out the best time to reset my HDPVRs, so basically I want to check for: Any recordings soon, any clients connected (PC Clients), any comskip jobs running, etc...if not I would kickoff my reset hdpvr script. Is it ready for something like this or have you not implemented some of that stuff in V3?

I dont need it to track the last time it ran or anything liek that I can keep track of that, even if it ran my exe every time it was in this "unused" state that would be ok and I would just return immediately if 1 day hadnt passed with the idea that eventually in the next 8 hrs or so it would hit this state again.

Love the app, not trying to rush you if you havent gotten to this stuff yet just checking in!
  #948  
Old 10-21-2009, 09:45 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
@gveres Load the GUI and have a look at the client restriction settings (Tools > Edit Settings). Seems you are not allowing localhost to connect to the SJQ server - that's what causes 403 errors.

The 500 comes about because you are not constructing a proper command request to the server and things won't play nice when the data payload of the request isn't in the proper format - that's expected. What it does mean, however, is that the server is allowing that IP in where as the server is blocking the 127.0.0.1 address. Again, have a look at the client restriction settings.
__________________
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...
  #949  
Old 10-21-2009, 09:51 PM
gveres gveres is offline
Sage Aficionado
 
Join Date: Nov 2007
Location: Waterloo, Ontario
Posts: 404
Quote:
Originally Posted by Slugger View Post
@gveres Load the GUI and have a look at the client restriction settings (Tools > Edit Settings). Seems you are not allowing localhost to connect to the SJQ server - that's what causes 403 errors.

The 500 comes about because you are not constructing a proper command request to the server and things won't play nice when the data payload of the request isn't in the proper format - that's expected. What it does mean, however, is that the server is allowing that IP in where as the server is blocking the 127.0.0.1 address. Again, have a look at the client restriction settings.

Thank you very much. That was it. I had it restricted to 192.168.1.0/24. I put in localhost and it worked fine.

Now for the rest of the configuration ....

Thanks Slugger, this is a great tool!

Greg
  #950  
Old 10-21-2009, 10:11 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by WhiteWhisker View Post
I am about to embark on this exact task (HDPVR reset), I posted a thread here talking about what I want to do and somebody pointed out your v3 version might do this, then I read this post etc: http://forums.sagetv.com/forums/showthread.php?p=387866

Your new V3 stuff looks great, I am in the process right now of moving my V2 rules over to the new system but I might as well upgrade to V3 betas...

So basically what I am trying to do is figure out the best time to reset my HDPVRs, so basically I want to check for: Any recordings soon, any clients connected (PC Clients), any comskip jobs running, etc...if not I would kickoff my reset hdpvr script. Is it ready for something like this or have you not implemented some of that stuff in V3?

I dont need it to track the last time it ran or anything liek that I can keep track of that, even if it ran my exe every time it was in this "unused" state that would be ok and I would just return immediately if 1 day hadnt passed with the idea that eventually in the next 8 hrs or so it would hit this state again.

Love the app, not trying to rush you if you havent gotten to this stuff yet just checking in!
It's all working*, I've hesitated on putting a snapshot build up on Google Code because I'm not quite ready to start supporting it yet. Just like the SJQ v1 > SJQ v2 upgrade path, the SJQ v2 > SJQ v3 path is quite a change in how things work and so I'm not quite ready to handle the Q&A nor have I properly updated the user guide for v3 yet (which will be a big key in avoiding many of the Qs from people).

The SystemMessage processing is in there and it appears to be working, but it hasn't been thoroughly tested (though it seems like you'll be testing it). All the key features I was aiming for are implemented and I've been running it for a few weeks now and it's been rock solid so functionally I'm not too worried, but, as I say, it's a matter of being ready for the Q&A/support requirements/etc.

The checks you want to do to decide if you want to run your reset bat script all exist except the ability to check if SJQ itself is running tasks. I could add a test to check this (maybe, probably), but given the client/server architecture, just because SJQ has assigned tasks to clients, doesn't mean they're running on the same host as the server. Of course, then you say, "well let me test that". Now things get more complicated. I won't bore you with the details, but suffice it to say, it's just harder.

The other issue right now is that I've got a new toy I'm playing with. If you notice my sig, I've finally got my new NAS server together and on the LAN. The 3TB of storage is exposed to my Sage server just begging to be used and so now I'm spending my evenings devising my archiving strategy. So until that's done, SJQ v3 dev work (actually all my plugin work) is currently on hold. The one big task remaining for SJQ v3 is a refactoring exercise - the code really needs a cleanup, but functionally, what I've been running for weeks now seems to work fine (pending further, more widespread testing from other users).

So I guess what I'm saying is that I'm not quite ready to release the beta on Google Code yet, but I am willing to allow people to get their hands on it with the understanding that I'm just not ready to do full scale support of it just yet. If that's something you're interested in then PM me and I'll provide a link to the beta build.

* Is anything really working? It works for me, I've been pleased with the results, but to claim there are absolutely no bugs in the code is ridiculous.
__________________
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...
  #951  
Old 10-22-2009, 06:54 AM
razrsharpe razrsharpe is offline
Sage Icon
 
Join Date: Sep 2008
Location: Boston, MA
Posts: 2,111
Quote:
Originally Posted by Slugger View Post
This is a request for feedback. I've implemented an initial version of the new SJQ v3 test and command syntax. Before I pat myself on the back, I'm going to explain what I've done and solicit some feedback on it.

The quick overview: Basically, I'm removing most of the tests in SJQ and replacing them with (limited) direct access to the underlying object being processed by SJQ. This accomplishes two key things:
  • Allow immediate access to new tests without the need to manually add the test and rebuild SJQ
  • Provides a general mechanism that is the basis for the addition of new object types that can be scanned by SJQ
Basically, I've introduced this new object called '$' that you will use in your tests to test against object specific info. The same '$' object can also be used in your command lines to easily allow the passing of any^ type of data to your command lines.

^ Only access to methods that are named Is*, Get*, and Has* is permitted and the return value of these methods must be a boolean, String or number; any other type is converted to a String via the object's toString() method.
just saw this and have a suggestion. What about allowing ANY Is*, Get*, or Has* method from any package (ie phoenix, ortus, etc) that has the form package_api_Method where Method starts with Is, Get, or Has. This can be built dynamically at the time of call. This is what we do in ortus for our advanced searching and filtering algorithm (its actually really awesome... i can filter by any Is* or Get* method from any package without having to rebuild the jar).
__________________
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
  #952  
Old 10-22-2009, 08:13 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
An interesting idea, but to support it I'd have to make some sweeping changes to the ruleset syntax. Maybe, but it just seems a ruleset call like this would be rather ugly:

if [$.phoenix_api_method_MethodName{} == "blah" ] {

}

Now imagine if the pkg name were longer and there were a half dozen or so different calls in there? It's definitely an interesting idea, one that I'll think about.
__________________
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...
  #953  
Old 10-22-2009, 08:24 AM
razrsharpe razrsharpe is offline
Sage Icon
 
Join Date: Sep 2008
Location: Boston, MA
Posts: 2,111
that's all i ask (that you think about it). My only comment would be, who cares how ugly it is as long as its functional and gets the job done...

Also not to nitpick but if i follow your syntax correctly doesn't your example have an extra method in there... shouldn't it be:


if [$.phoenix_api_MethodName{} == "blah" ] {

}
__________________
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
  #954  
Old 10-22-2009, 11:56 AM
mguebert mguebert is offline
Sage Advanced User
 
Join Date: Jan 2007
Posts: 152
Slugger,

I am trying to get my ruleset to avoid processing shows on channels 500 - 540, which are Premium content channels. My rule for this looks like this


&& ChannelNumber != "5(?:[0-4][0-9]|40)

which is actually a sample from one you posted, modified I thought to work with my channel range. Unfortunately it is not working. Any thoughts?
  #955  
Old 10-22-2009, 03:05 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by mguebert View Post
Slugger,

I am trying to get my ruleset to avoid processing shows on channels 500 - 540, which are Premium content channels. My rule for this looks like this


&& ChannelNumber != "5(?:[0-4][0-9]|40)

which is actually a sample from one you posted, modified I thought to work with my channel range. Unfortunately it is not working. Any thoughts?
The operator should be !% not !=

!% means "does not match regex" and != mean "does not equal". The latter being a literal string matching test, the former using regular expressions.

Also, you should use this regex:

5(?:[0-3][0-9]|40)

What you have would actually match 500-549
__________________
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...
  #956  
Old 10-22-2009, 07:16 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
SJQ v3 Beta...

I've had enough PMs that it's just easier to post it on Google Code with the following warning:

I'm not ready to provide full support of v3 yet. The beta is on Google Code, I encourage those interested to use it and provide feedback, bug reports, etc, but the docs aren't ready and I'm not ready to provide step by step instructions for everyone.

Please be sure to read this wki doc before installing a v3 beta. Upgrading to v3 will modify your sjq database file such that it can't be used for v2 anymore so be sure to make a backup before upgrading.

Go back a page or so in the thread to read up about the new "$" object. Most v2 rulesets will error out in v3 because many of the tests have been removed and are instead referenced via the $ object. If I've removed a test you find useful and it's not available through $ then let me know and I'll see about getting it back in there.

Jobs can be cancelled/killed - click on a running job in the active queue to get that option.

System messages can be processed in addition to media files. When processing a sys msg, $ refers to that SystemMessage object as far as calling methods for tests.

Use the new IsObjMediaFile and IsObjSysMsg tests to determine the type of object you're processing (and therefore the type of object $ refers to).

I'm sure I'm missing some more details, but that's all I can think of right now.
__________________
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...
  #957  
Old 10-27-2009, 10:47 AM
gveres gveres is offline
Sage Aficionado
 
Join Date: Nov 2007
Location: Waterloo, Ontario
Posts: 404
Can anybody help me debug this rule?

if [IsTV == "true" && IsActivelyRecording == "false" && Filename =$ ".mpg" && (Title == "Back at the Barrnyard" || Title == "Danny Phantom" || Title == "Drake & Josh" || Title == "Hannah Montana" || Title == "Imagination Movers" || Title == "Johnny Test" || Title == "Jonas" || Title == "Kim Possible" || Title == "Life With Derek" || Title == "Lizzie McGuire" || Title == "Phineas and Ferb" || Title == "Sonny With a Chance" || Title == "SpongeBob SquarePants" || Title == "Tak and the Power of Juju" || Title == "The Emperor's New School" || Title == "The Fairly OddParents" || Title == "The Latest Buzz" || Title == "The Penguins of Madagascar" || Title == "The Replacements" || Title == "The Suite Life of Zack & Cody" || Title == "The Suite Life on Deck" || Title == "Wizards of Waverly Place" || Title == "Zoey 101" || Title == "iCarly" ) ]
{
:PRIORITY -10
KIDSCOMPRESS
}

I think SJQ is processing all the ||s of the titles as &&s instead. But i put brackets around them. I am trying to call the KIDSCOMPRESS rule for all those shows.

But when I run the debugger on this media file:

E:\PVR Files\Sage Recordings\WizardsofWaverlyPlace-PopMeandWeBothGoDown-5891353-0.mpg

I don't get that rule triggering. Instead I get this debug output:

Code:
2009/10/27 12:39:46.251		Line 37: Evaluating 'IsTV == "true"' == true
2009/10/27 12:39:46.251		Line 37: Evaluating 'IsActivelyRecording == "false"' == true
2009/10/27 12:39:46.251		MediaVar '%s%' == 'Pop Me and We Both Go Down'
2009/10/27 12:39:46.251		MediaVar '%y%' == ''
2009/10/27 12:39:46.251		MediaVar '%c%' == 'E:\PVR Files\Sage Recordings\WizardsofWaverlyPlace-PopMeandWeBothGoDown-5891353-0.mpg'
2009/10/27 12:39:46.251		MediaVar '%d%' == 'E:\PVR Files\Sage Recordings'
2009/10/27 12:39:46.251		MediaVar '%f%' == 'WizardsofWaverlyPlace-PopMeandWeBothGoDown-5891353-0.mpg'
2009/10/27 12:39:46.251		MediaVar '%e%' == 'mpg'
2009/10/27 12:39:46.251		MediaVar '%p%' == 'WizardsofWaverlyPlace-PopMeandWeBothGoDown-5891353-0'
2009/10/27 12:39:46.251		MediaVar '%t%' == 'Wizards of Waverly Place'
2009/10/27 12:39:46.251		Line 37: Evaluating 'Filename =$ ".mpg"' == true
2009/10/27 12:39:46.251		Line 37: Evaluating 'Title == "Back at the Barrnyard"' == false
2009/10/27 12:39:46.251		Line 37: Evaluating 'Title == "Danny Phantom"' == false
2009/10/27 12:39:46.251		Line 37: Evaluating 'Title == "Drake & Josh"' == false
2009/10/27 12:39:46.251		Line 37: Evaluating 'Title == "Hannah Montana"' == false
2009/10/27 12:39:46.251		Line 37: Evaluating 'Title == "Imagination Movers"' == false
2009/10/27 12:39:46.251		Line 37: Evaluating 'Title == "Johnny Test"' == false
2009/10/27 12:39:46.251		Line 37: Evaluating 'Title == "Jonas"' == false
2009/10/27 12:39:46.251		Line 37: Evaluating 'Title == "Kim Possible"' == false
2009/10/27 12:39:46.251		Line 37: Evaluating 'Title == "Life With Derek"' == false
2009/10/27 12:39:46.251		Line 37: Evaluating 'Title == "Lizzie McGuire"' == false
2009/10/27 12:39:46.251		Line 37: Evaluating 'Title == "Phineas and Ferb"' == false
2009/10/27 12:39:46.251		Line 37: Evaluating 'Title == "Sonny With a Chance"' == false
2009/10/27 12:39:46.251		Line 37: Evaluating 'Title == "SpongeBob SquarePants"' == false
2009/10/27 12:39:46.251		Line 37: Evaluating 'Title == "Tak and the Power of Juju"' == false
2009/10/27 12:39:46.251		Line 37: Evaluating 'Title == "The Emperor's New School"' == false
2009/10/27 12:39:46.251		Line 37: Evaluating 'Title == "The Fairly OddParents"' == false
2009/10/27 12:39:46.251		Line 37: Evaluating 'Title == "The Latest Buzz"' == false
2009/10/27 12:39:46.251		Line 37: Evaluating 'Title == "The Penguins of Madagascar"' == false
2009/10/27 12:39:46.251		Line 37: Evaluating 'Title == "The Replacements"' == false
2009/10/27 12:39:46.251		Line 37: Evaluating 'Title == "The Suite Life of Zack & Cody"' == false
2009/10/27 12:39:46.251		Line 37: Evaluating 'Title == "The Suite Life on Deck"' == false
2009/10/27 12:39:46.251		Line 37: Evaluating 'Title == "Wizards of Waverly Place"' == true
2009/10/27 12:39:46.266	LogCleaner instance started
2009/10/27 12:39:46.266	FileCleaner instance started
Thanks
Greg
  #958  
Old 10-27-2009, 11:01 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
What version of SJQ are you running?
__________________
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...
  #959  
Old 10-27-2009, 11:56 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
I'm assuming you're running v2.1.5.542 and if so, then I can't reproduce the error - the ORs are working as expected when I try a similar test block as the one you have.

Is it possible that the program you're trying has already been processed by that task? In that case, even though the test passes for the recording, SJQ won't add it to the queue if it's already run that task on it (even if the task failed - check your failed tasks list under the Data menu).

To test that theory, comment out that current test block, add the following test block, go to settings and turn on debug logging, then rerun the file through the media debugger and have a look at the output in the logs.

Code:
if [IsTV == "true" && IsActivelyRecording == "false" && Filename =$ ".mpg" && Title == "Wizards of Waverly Place"]
{
:PRIORITY -10
KIDSCOMPRESS
}
If it's a bug with the parser/processor then the task should be added to the queue with this ruleset, if it's still not being added then it's likely that SJQ thinks it's already run the 'KIDSCOMPRESS' task against the recording (and the debug output should confirm that).
__________________
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...
  #960  
Old 10-27-2009, 02:19 PM
gveres gveres is offline
Sage Aficionado
 
Join Date: Nov 2007
Location: Waterloo, Ontario
Posts: 404
Ok. I will check.

yes I am running the latest 2.x version. I just set this up about 2 weeks ago.

Greg
Closed Thread


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: Sage Job Queue (SJQ) v3 Slugger SageTV Customizations 1355 07-25-2013 07:44 AM
Sage Job Queue (SJQ) new release notifications Slugger Customization Announcements 3 12-17-2009 09:59 AM
Sage Job Queue Completed tasks problem raffmanlt SageTV Customizations 2 08-18-2009 07:34 PM
Comskip Monitor VS Sage Job Queue SJQ personalt SageTV Customizations 6 03-02-2009 10:27 AM
Plugin: SJQ v1.1.0RC1 Available - Testers Needed Slugger SageTV Customizations 35 04-21-2008 08:12 AM


All times are GMT -6. The time now is 02:45 AM.


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