SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Customizations

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.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 11-05-2009, 04:23 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Arrow Plugin: Sage Job Queue (SJQ) v3

Given the sweeping changes between SJQ v1 and the new SJQ v3, I feel it appropriate to start a new thread specifically for SJQ v3 support.

Please post only about SJQ v3 in this thread. SJQ v2 support can be had in this thread.

SJQ v3 is now officially open to support questions.

Please visit the project download site and grab the latest version (3.0.0.640 as of this post). Be sure to read the beta upgrade wiki before upgrading from SJQ v2. New users to SJQ v3 can ignore that wiki doc.

An initial draft of the SJQ v3 User's Guide is now available. It's a draft, it's rough, but most of the examples have been updated. Please feel free to point out errors and omissions in the doc.

A quick cheat sheet for users migrating from v2 to v3 will be available in a day or two (or three or four, i.e. some time sort of soon). Most of the tips to be included in that doc are scattered throughout the old support thread ($ object, kill active processes, IsObj* tests, etc.).

Please note, SJQ v3 is still in beta!
__________________
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
  #2  
Old 11-06-2009, 11:35 AM
nyplayer nyplayer is offline
SageTVaholic
 
Join Date: Sep 2005
Posts: 4,050
Slugger,

Question about _RUNQLOADER can this be run more than once.

for example

Rule # 1 runs a task QFIX against a media object then _RUNQLOADER

Rule # 2 runs COMSKIP against the same media object can I schedule another _RUNQLOADER in rule 2
__________________
Windows 10 I3 Dual Core 3.0 Server, SageTV9... OpenDCT with 2 HDHRPrimes and 4 HDHRconnects for a total of 14 Tuners.
Reply With Quote
  #3  
Old 11-06-2009, 02:10 PM
tomfisk's Avatar
tomfisk tomfisk is offline
Sage Advanced User
 
Join Date: Oct 2006
Location: Plainview, MN
Posts: 86
Upgraded...can't log in...old version?

I just upgraded to 3.0.0.640. During the upgrade I shutdown the SageTV service, made a copy of the sjq.sqlite file, and installed the new version. The sjq.war file in the jetty/webapps directory shows a date of 11/4/09.

When I get to the login screen it isn't recognizing my password nor the default "sjqadmin". Additionally, when I click on the "About" under help it shows a dialog box with 2.1.5.484 as the version...???!!!

I did upgrade to the 1.6 Jetty release...and tested the old SJQ (coincidentally 2.1.5.484) to make sure the jetty installation was stable...everything worked fine. I also switched over to the jetty version of the webserver and that is running without problem.

So...is something being cached somewhere that needs to be flushed? Did I miss something in the upgrade?
__________________
Check it out! - http://www.vholdr.com/video/playing-sky
Reply With Quote
  #4  
Old 11-06-2009, 02:31 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by tomfisk View Post
I just upgraded to 3.0.0.640. During the upgrade I shutdown the SageTV service, made a copy of the sjq.sqlite file, and installed the new version. The sjq.war file in the jetty/webapps directory shows a date of 11/4/09.

When I get to the login screen it isn't recognizing my password nor the default "sjqadmin". Additionally, when I click on the "About" under help it shows a dialog box with 2.1.5.484 as the version...???!!!

I did upgrade to the 1.6 Jetty release...and tested the old SJQ (coincidentally 2.1.5.484) to make sure the jetty installation was stable...everything worked fine. I also switched over to the jetty version of the webserver and that is running without problem.

So...is something being cached somewhere that needs to be flushed? Did I miss something in the upgrade?
Probably just your browser's cache. If you're indeed running SJQv3 then in the root install dir of Sage should be the sjq.log file. If that file's there and it's being updated periodically then SJQv3 is running on the server. And if so, then you just need to wipe the browser cache to ensure you're getting the new GUI (the 2.1.5 GUI you're seeing definitely will fail to communicate the pwd [or anything] to a SJQv3 server).
__________________
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
  #5  
Old 11-06-2009, 03:10 PM
tomfisk's Avatar
tomfisk tomfisk is offline
Sage Advanced User
 
Join Date: Oct 2006
Location: Plainview, MN
Posts: 86
Quote:
Originally Posted by Slugger View Post
Probably just your browser's cache. If you're indeed running SJQv3 then in the root install dir of Sage should be the sjq.log file. If that file's there and it's being updated periodically then SJQv3 is running on the server. And if so, then you just need to wipe the browser cache to ensure you're getting the new GUI (the 2.1.5 GUI you're seeing definitely will fail to communicate the pwd [or anything] to a SJQv3 server).
Yep...that was it...very strange that a CTRL/Refresh didn't even work...had to actually go and delete the cache from the settings (Firefox).
__________________
Check it out! - http://www.vholdr.com/video/playing-sky
Reply With Quote
  #6  
Old 11-06-2009, 04:00 PM
tomfisk's Avatar
tomfisk tomfisk is offline
Sage Advanced User
 
Join Date: Oct 2006
Location: Plainview, MN
Posts: 86
GetShowTitle warnings

I've pre-pended all my rules with "IsObjMediaFile == true" but I'm still getting a slew of

2009-11-06 15:47:45,046 WARN [RulesParser]: Unable to invoke method 'GetShowTitle'; return false for test!

warnings.

Any ideas?
__________________
Check it out! - http://www.vholdr.com/video/playing-sky
Reply With Quote
  #7  
Old 11-06-2009, 02:28 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by nyplayer View Post
Slugger,

Question about _RUNQLOADER can this be run more than once.

for example

Rule # 1 runs a task QFIX against a media object then _RUNQLOADER

Rule # 2 runs COMSKIP against the same media object can I schedule another _RUNQLOADER in rule 2
You're going to have to test that and let me know. I believe it's only going to run it once. Actually, it'd be a bug if it ran it more than once (for the same media file). I was aware of this when I wrote those internal tasks and am trying to think of a way to make those tasks "special" such that they don't attach themselves to a specific object, but instead you can just throw them into a rule block and have them run. My initial result was that it wouldn't be easy so I just implemented them as they are now (i.e. you can only run the tasks once per scanned object).

I can see a need/desire to be able to trigger those two tasks arbitrarily and more than once (actually the use case that triggered the addition of those tasks would probably want this behaviour as well).

Those tasks are likely to change before v3 is moved out of beta. For now, however, I think they're only going to run once (per media file). Please let me know if that's what you're seeing.
__________________
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
  #8  
Old 11-06-2009, 03:00 PM
nyplayer nyplayer is offline
SageTVaholic
 
Join Date: Sep 2005
Posts: 4,050
Quote:
Originally Posted by Slugger View Post
You're going to have to test that and let me know. I believe it's only going to run it once. Actually, it'd be a bug if it ran it more than once (for the same media file). I was aware of this when I wrote those internal tasks and am trying to think of a way to make those tasks "special" such that they don't attach themselves to a specific object, but instead you can just throw them into a rule block and have them run. My initial result was that it wouldn't be easy so I just implemented them as they are now (i.e. you can only run the tasks once per scanned object).

I can see a need/desire to be able to trigger those two tasks arbitrarily and more than once (actually the use case that triggered the addition of those tasks would probably want this behaviour as well).

Those tasks are likely to change before v3 is moved out of beta. For now, however, I think they're only going to run once (per media file). Please let me know if that's what you're seeing.
Yes it only runs once per media object... being able to run _SCANMEDIA and _RUNQLOADER without being attached to an object would be great.
__________________
Windows 10 I3 Dual Core 3.0 Server, SageTV9... OpenDCT with 2 HDHRPrimes and 4 HDHRconnects for a total of 14 Tuners.
Reply With Quote
  #9  
Old 11-07-2009, 10:32 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by nyplayer View Post
Yes it only runs once per media object... being able to run _SCANMEDIA and _RUNQLOADER without being attached to an object would be great.
Issue ticket 91 details the solution I plan on implementing for this. Hopefully it makes sense? Basically going to drop these internal tasks and make them options that the task queue will then run after the task completes successfully.

Code:
if [IsObjMediaFile == true && $.GetShowTitle{} == "Seinfeld"] {
   :SCANMEDIA "true"
   :RUNQLOADER "true"
   :PRIORITY 100
   MYTASK
}
And so if MYTASK completes successfully then the task queue will also run a media scan then the queue loader (with the media scan always occurring before the queue loader is triggered). Busy weekend so probably won't be until early next week before I get a chance to implement this, but the idea popped into my head late last night so I thought I should write it down.
__________________
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
  #10  
Old 11-08-2009, 07:59 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Snapshot 647 contains the fix to move those two internal tasks to task options; implemented exactly as described above.
__________________
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
  #11  
Old 04-21-2010, 09:39 PM
zzmystique's Avatar
zzmystique zzmystique is offline
Sage Advanced User
 
Join Date: May 2004
Location: New Zealand
Posts: 211
I'm using QFIX on all my recordings and need a little help with some rules, to get them to complete successfully.

1. Detecting if a recording is in multiple parts. (only seems to QFIX myfile-0.ts not myfile-1.ts etc..)
2. Detecting if the recording to be QFixed is currently being viewed.

here is the relevant part of the server ruleset.

// QuickStreamFix all recordings
if [IsObjMediaFile == true && $.IsTVFile{} == true && $.IsFileCurrentlyRecording{} == false && Filename =$ ".ts" && FileExists != "%d%/%p%.QFixed"]{
:SCANMEDIA "true"
:RUNQLOADER "true"
:PRIORITY 100
QSF
}

What do I add to the above ruleset to detect multiple parts and check if the file is in use?

Cheers.
__________________
ZZMystique
My setup: Server: SageTV v7, Intel i5, 8GB, 180GB SSD, 4TB HDD, Win7HP & (DVB Viewer Pro with DVB Viewer for SageTV using 2xTBS6281 DVB-T2).

Last edited by zzmystique; 04-21-2010 at 09:49 PM. Reason: more info added
Reply With Quote
  #12  
Old 04-22-2010, 04:46 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by zzmystique View Post
I'm using QFIX on all my recordings and need a little help with some rules, to get them to complete successfully.

1. Detecting if a recording is in multiple parts. (only seems to QFIX myfile-0.ts not myfile-1.ts etc..)
2. Detecting if the recording to be QFixed is currently being viewed.

here is the relevant part of the server ruleset.

// QuickStreamFix all recordings
if [IsObjMediaFile == true && $.IsTVFile{} == true && $.IsFileCurrentlyRecording{} == false && Filename =$ ".ts" && FileExists != "%d%/%p%.QFixed"]{
:SCANMEDIA "true"
:RUNQLOADER "true"
:PRIORITY 100
QSF
}

What do I add to the above ruleset to detect multiple parts and check if the file is in use?

Cheers.
It should be running the command on all file segments, not just the first one. If it's not then that's a bug. Which version 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...
Reply With Quote
  #13  
Old 04-22-2010, 05:34 AM
zzmystique's Avatar
zzmystique zzmystique is offline
Sage Advanced User
 
Join Date: May 2004
Location: New Zealand
Posts: 211
Quote:
Originally Posted by Slugger View Post
It should be running the command on all file segments, not just the first one. If it's not then that's a bug. Which version are you running?
It is only doing the first file, not all of them.

I'm running version 3.0.2.790 with the upgraded SageTV common-logging jar files.

Edit: have updated to the latest version (version v3.0.2.792) and made the following changes to my ruleset.

// Merge multiple file segments before processing other tasks
if [IsObjMediaFile == true && $.IsTVFile{} == true && $.IsFileCurrentlyRecording{} == false && Filename =$ ".ts" && $.GetNumberOfSegments{} != "1" && FileExists == "%c%.xml"]{
:SCANMEDIA "true"
:PRIORITY 20
MERGESPLITFILES
}


// QuickStreamFix all recordings
if [IsObjMediaFile == true && $.IsTVFile{} == true && $.IsFileCurrentlyRecording{} == false && Filename =$ ".ts" && FileExists != "%d%/%p%.QFixed" && $.GetNumberOfSegments{} == "1" && (TimeOfDay < "19:00" || TimeOfDay > "23:00")]{
:SCANMEDIA "true"
:RUNQLOADER "true"
:PRIORITY 10
QSF
}

Is there a better way to check for split files? Also check whether the file to be QSFixed is currently in use?

Cheers
__________________
ZZMystique
My setup: Server: SageTV v7, Intel i5, 8GB, 180GB SSD, 4TB HDD, Win7HP & (DVB Viewer Pro with DVB Viewer for SageTV using 2xTBS6281 DVB-T2).

Last edited by zzmystique; 04-23-2010 at 05:17 AM. Reason: more info
Reply With Quote
  #14  
Old 04-22-2010, 07:54 AM
razrsharpe razrsharpe is offline
Sage Icon
 
Join Date: Sep 2008
Location: Boston, MA
Posts: 2,111
Quote:
Originally Posted by zzmystique View Post
Is there a better way to check for split files?
GetNumberOfSegments will return the number of segments for the passed mediafile... so you could use that to make sure that it the qsfix only runs on single item media files...

Quote:
Also check and whether the file to be QSFixed is currently in use?
you could do conceivably do this with some custom java methods that loop through each UIContext, compare the currently loaded mediafile against the passed mediafile, and return true/false. I do not know of any single Sage method or internal SJQ test that does this...
__________________
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
  #15  
Old 04-22-2010, 08:34 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
I'd manually run the GetNumberOfSegments API call in Studio against a media file and ensure that Sage believes there is more than 1 segment. SJQ will only run the command against each segment if Sage API tells SJQ that there is more than one. Last time I tested this it worked and was confirmed as working by someone else. I rarely, if ever, have multi segmented recordings to test this with, but you can see if SJQ is trying to run the command because you'll see the header lines in the log for the task for each segment.

There currently is no test to determine if a specific media file is in use by a client/extender. As suggested, a custom java test would be needed (or an internal test added to SJQ). The latter is unlikely to happen anytime soon (I'm currently working on other things right now and SJQ enhancements aren't at the top of the list). With that said, I would encourage you to add a feature request ticket at the proj site if it's something you really want added.
__________________
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
  #16  
Old 05-15-2010, 05:04 PM
rmac321 rmac321 is offline
Sage Advanced User
 
Join Date: Dec 2008
Posts: 194
First - thanks for the great tool. I've finally decided to invest the time to learn to use SJQ and am having great success automating a bunch of stuff.

The question - Is there a test for whether a specific recording is being watched? If I understand correctly, the test "IsViewingMedia" is actually a test for whether anything at all is currently being watched. It would be nice to have a quick test for whether a specific file is being watched before attempting a relink or a move. I took a quick look at the Sage API listing, but I don't see anything obvious like "IsBeingWatched"
__________________
SageTV v9.1.10.479 on Ubuntu
(testing v9.1.10.479 on Debian and Win10)
Reply With Quote
  #17  
Old 05-15-2010, 05:14 PM
rmac321 rmac321 is offline
Sage Advanced User
 
Join Date: Dec 2008
Posts: 194
FWIW - the SJQ User's Guide on the googlecode site won't load today.
__________________
SageTV v9.1.10.479 on Ubuntu
(testing v9.1.10.479 on Debian and Win10)
Reply With Quote
  #18  
Old 05-15-2010, 09:51 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by rmac321 View Post
FWIW - the SJQ User's Guide on the googlecode site won't load today.
Yes, had to take it offline for awhile. I created the PDF version and posted it in the downloads section. That PDF is the final version of the SJQ 3.0.x User's Guide.
__________________
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
  #19  
Old 05-17-2010, 05:28 PM
rmac321 rmac321 is offline
Sage Advanced User
 
Join Date: Dec 2008
Posts: 194
Quote:
Originally Posted by Slugger View Post
Yes, had to take it offline for awhile. I created the PDF version and posted it in the downloads section. That PDF is the final version of the SJQ 3.0.x User's Guide.
Will the online version no longer be available? There are a few places to modify if that link is no longer going to be valid. The link on the Sage Add-ons page on Google.code (http://code.google.com/p/sagetv-addons/) links to the online version. SJQ's own drop down help menu goes to the dead link. Also, your first post in this thread still has the link to the online version. The first post could use a pointer to the SJQ downloads as well.

Another issue to figure out. The pdf looks good, but the right half of the "Available Tests" chart (starts on page 20) goes off the page. That chart was the main reason I kept referring back to the online version since my attempt to make a pdf of the guide produced the same cropped table. Since I was using the online version, I never made a second attempt to copy that table.

Thanks!
__________________
SageTV v9.1.10.479 on Ubuntu
(testing v9.1.10.479 on Debian and Win10)

Last edited by rmac321; 05-17-2010 at 05:44 PM.
Reply With Quote
  #20  
Old 05-18-2010, 01:47 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
The online version will be available again in the not too distant future.
__________________
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)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Sage Job Queue (SJQ) new release notifications Slugger Customization Announcements 3 12-17-2009 09:59 AM
Plugin: Sage Job Queue (SJQ) Slugger SageTV Customizations 991 12-11-2009 03:52 PM
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 01:49 PM.


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