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
  #781  
Old 05-02-2011, 08:24 AM
grbsaaber grbsaaber is offline
Sage User
 
Join Date: Feb 2006
Posts: 24
Got everything up and running. Having trouble excluding certain channels that have no commercials, i.e. starz, etc.

Does anyone have an example script that would help me out.

Thanks in advance.
Reply With Quote
  #782  
Old 05-02-2011, 09:53 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
What script are you using?
__________________
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
  #783  
Old 05-02-2011, 09:55 AM
grbsaaber grbsaaber is offline
Sage User
 
Join Date: Feb 2006
Posts: 24
Currently using the one on your site for comskip with no mods. I changed one of the true false values so it ignores the file type passed.

Thanks for the response.
Reply With Quote
  #784  
Old 05-02-2011, 10:08 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
This one?

If so, add this block right above the last line (return 0):

Code:
if(AiringAPI.GetAiringChannelName(mf) ==~ /HBO.*|STARZ.*|SHO.*|PPV.*|PBS.*|HDNET.*/)
   return 2
Adjust the channel names accordingly. However, the reason such a check isn't in that script is because my example that uses this script attaches the task to specific favourites. Ideally, you just wouldn't attach the comskip tasks to favs that come from channels known not to have commercials.

If, however, you're queuing up tasks different (say, just attaching to the RecordingStarted event for all recordings) then, yes, you probably want to add this kind of check.
__________________
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
  #785  
Old 05-02-2011, 10:43 AM
grbsaaber grbsaaber is offline
Sage User
 
Join Date: Feb 2006
Posts: 24
Thanks Ill try it out.

Do I need to close the if statement and open it with {} like below. Just want to confirm in case someone else uses the if statement below.

if(AiringAPI.GetAiringChannelName(mf) ==~ /HBO.*|STARZ.*|SHO.*|PPV.*|PBS.*|HDNET.*/) {
return 2
}
return 0

Last edited by grbsaaber; 05-02-2011 at 10:46 AM.
Reply With Quote
  #786  
Old 05-02-2011, 10:47 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Your edit, as presented, is syntactically invalid. If you're going to close it with a } then you need to include the opener...

Code:
if(...) {
   return 2
}
return 0
Or, since it's a single statement if block, the braces aren't necessary, as I had them:

Code:
if(...)
   return 2
return 0
Both are equivalent. The details as to why are in Java/Groovy books/documentation.

EDIT: You went and fixed your typo. So now your edit is syntactically correct and equivalent to mine.
__________________
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
  #787  
Old 05-02-2011, 10:49 AM
grbsaaber grbsaaber is offline
Sage User
 
Join Date: Feb 2006
Posts: 24
Thanks, I added the other bracket but you must have been replying already.

Thank you very much! SJQ4 seems to be much smoother than SJQ3 and less resources intensive.
Reply With Quote
  #788  
Old 05-02-2011, 06:50 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by Slugger View Post
IMPORTANT: A task client plugin update will be released at some point over the weekend (probably Sunday afternoon). If you also have the Jetty plugin installed then read the following carefully.

If you don't have Jetty installed then you can ignore this message. If you have the web interface, mobile interface, SageAlert, SRE or possibly other plugins installed then you also have Jetty installed and this applies to you.

Before upgrading the task client to the new release, you MUST upgrade Jetty to its latest version first. It is safe to upgrade the SJQv4 task client plugin only after you've upgraded Jetty. The required Jetty update is already available in the plugin manager and can be installed immediately.

If you upgrade the SJQv4 task client without upgrading Jetty first you will end up with duplicate jars in your SageTV\JARs folder and things aren't likely going to work as desired.

Unfortunately, the SageTV plugin manager has no way for us to automate this or prevent the conflict from occurring if you don't follow these instructions. If you don't update Jetty first then you will end up with duplicate jars, which will cause you problems.

Again, the task client update is scheduled for release by Sunday afternoon.
This update was released earlier this morning. Please review my upgrade instructions for this update...
__________________
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
  #789  
Old 05-02-2011, 08:54 PM
grbsaaber grbsaaber is offline
Sage User
 
Join Date: Feb 2006
Posts: 24
jetty was already up to date. I updated and my client won't come back online.

Any suggestions on what I can look for. Says internal error.

I tried deleting and readding the client but that didn't work.

It says Connection refused: connect, it has ben marked as OFFline

Quote:
2011-05-02 21:06:10,602 ERROR [CommandFactory]: Error
java.lang.ClassNotFoundException: com.google.code.sagetvaddons.sjq.agent.commands.Ping
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.google.code.sagetvaddons.sjq.listener.CommandFactory.get(CommandFactory.java:30)
at com.google.code.sagetvaddons.sjq.listener.Handler.run(Handler.java:64)
at java.lang.Thread.run(Unknown Source)
2011-05-02 21:06:10,603 ERROR [CommandFactory]: Error
java.lang.ClassNotFoundException: com.google.code.sagetvaddons.sjq.agent.commands.Quit
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.google.code.sagetvaddons.sjq.listener.CommandFactory.get(CommandFactory.java:30)
at com.google.code.sagetvaddons.sjq.listener.Handler.run(Handler.java:64)
at java.lang.Thread.run(Unknown Source)

Last edited by grbsaaber; 05-02-2011 at 08:59 PM. Reason: added logs
Reply With Quote
  #790  
Old 05-02-2011, 09:16 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Looks like you're missing the sjq-agent.jar file. Check your SageTV\JARs\ folder. Is there an sjq-agent.jar file? If so, is there more than one? If so, what's in there? If you don't have one, go to the plugin manager, does it say the sjq-agent plugin is installed? If it says it is, but the jar is not in JARs then your plugin manager is corrupt. Uninstall the plugin and reinstall it. If it's in there then make sure there is not more than one. If there's only one report the bug to Sage, with your current logs. Restarting your system should then fix the problem (probably a bug with Sage's custom classloader).
__________________
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
  #791  
Old 05-02-2011, 09:23 PM
grbsaaber grbsaaber is offline
Sage User
 
Join Date: Feb 2006
Posts: 24
There is only one sjq-agent.jar. I reinstalled and rebooted sage but still have same issue.

should I reboot the server ?
Rebooting the server and will see what happens.
Rebooting the server cleared it all out. Now to submit a bug to sage.

Last edited by grbsaaber; 05-02-2011 at 09:31 PM.
Reply With Quote
  #792  
Old 05-03-2011, 10:39 AM
bikesquid's Avatar
bikesquid bikesquid is offline
Sage Aficionado
 
Join Date: Jan 2010
Location: California's North Coast
Posts: 392
@Slugger: I'm finally getting to testing multi-segment recordings and don't understand why this is coming back this way. Any suggestions appreciated!

Code:
 else if(numSegments > 1) {
        for(def i2 = 0; i < numSegments; ++i2) {
            def prefix = FilenameUtils.getBaseName(MediaFileAPI.GetFileForSegment(mf, i2).getAbsolutePath())
            def segPrefix = "$newPrefix-$i2"
            println "Renaming files that look like '${prefix}.*' to '${segPrefix}.*'..."
            renameMatches(MediaFileAPI.GetParentDirectory(mf), prefix, null, segPrefix)
        }
The resulting error is:
Code:
New file is: House - S07E20.ts
fullfilename is: House - S07E20.ts
Renaming files that look like 'House-Changes-4674021-0.*' to 'House - S07E20-0.*'...
Renaming files that look like 'House-Changes-4674021-1.*' to 'House - S07E20-1.*'...
Exception thrown

java.lang.NullPointerException: Cannot invoke method getAbsolutePath() on null object

    at rename_comskip.run(rename_comskip.groovy:81)
It's doing the rename correctly but then throws the exception.... line 81 starts with 'def prefix...'
Reply With Quote
  #793  
Old 05-03-2011, 11:18 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
It seems numSegments == 3, but when trying to grab the third segment it's returning null when it shouldn't. Are there actually 3 segments to that recording?
__________________
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
  #794  
Old 05-03-2011, 11:55 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
Maybe I'm missing something Groovy specific, but why are you checking "i < numSegments" in the for statement instead of "i2"?
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
  #795  
Old 05-03-2011, 11:57 AM
bikesquid's Avatar
bikesquid bikesquid is offline
Sage Aficionado
 
Join Date: Jan 2010
Location: California's North Coast
Posts: 392
Quote:
Originally Posted by Slugger View Post
It seems numSegments == 3, but when trying to grab the third segment it's returning null when it shouldn't. Are there actually 3 segments to that recording?
No, there are just two, and based on this I tossed in a println numSegments just before and it returned 2....
Code:
else if(numSegments > 1) {
    println numSegments
        for(def i2 = 0; i < numSegments; ++i2) {
            def prefix = FilenameUtils.getBaseName(MediaFileAPI.GetFileForSegment(mf, i2).getAbsolutePath())
            def segPrefix = "$newPrefix-$i2"
            println "Renaming files that look like '${prefix}.*' to '${segPrefix}.*'..."
            renameMatches(MediaFileAPI.GetParentDirectory(mf), prefix, null, segPrefix)
        }
    }
output is now:
Code:
New file is: House - S07E20.ts
fullfilename is: House - S07E20.ts
2
Renaming files that look like 'House-Changes-4674021-0.*' to 'House - S07E20-0.*'...
Renaming files that look like 'House-Changes-4674021-1.*' to 'House - S07E20-1.*'...
Exception thrown

java.lang.NullPointerException: Cannot invoke method getAbsolutePath() on null object

    at rename_comskip.run(rename_comskip.groovy:82)
Reply With Quote
  #796  
Old 05-03-2011, 12:07 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by tmiranda View Post
Maybe I'm missing something Groovy specific, but why are you checking "i < numSegments" in the for statement instead of "i2"?
Quote:
Originally Posted by bikesquid View Post
No, there are just two, and based on this I tossed in a println numSegments just before and it returned 2....
Tom spotted it... you're using i as the comparison in the for statement, but incrementing i2.

for(i2 = 0; i2 < numSegments; ++i2)

So the for loop never exits and eventually you attempt to seek outside the array's bounds, ending in a null pointer exception as you've encountered. Change that i to an i2 as shown above and you should be good to go.
__________________
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
  #797  
Old 05-03-2011, 01:36 PM
bikesquid's Avatar
bikesquid bikesquid is offline
Sage Aficionado
 
Join Date: Jan 2010
Location: California's North Coast
Posts: 392
Thanks guys!
I guess that's what I get for plagiarizing Sluggers code without understanding it!(or being able to type)

So then I have a follow-up question about multi-segment recordings and how to relink them to the external ID? I've got this code working with single-segment shows, but how would I link multiple files to the show correctly?

fullfilename is what I expect I would link to the segment(s) full path+filename+segment#+extension, but I don't see anything in the API docs referencing multi-segment recordings and how to do this....
Code:
def mf = MediaFileAPI.GetMediaFileForID(SJQ4_METADATA["SJQ4_ID"].toInteger())
def newDir = MediaFileAPI.GetParentDirectory(mf)
def src = newDir.toString() + "\\$fullfilename"
def sid = ShowAPI.GetShowExternalID(mf)
def show = ShowAPI.GetShowForExternalID(sid)
def mfadd = MediaFileAPI.AddMediaFile(new File(src), null)
if(!MediaFileAPI.SetMediaFileShow(mfadd, show)) {
   println "Failed to link show metadata to media file!"
   return 1
}
Reply With Quote
  #798  
Old 05-03-2011, 02:12 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
I never actually tested it, but way back when in the early 7.0 betas, I believe, Jeff told us that all you should have to do is link segment 0 to the show and the core will figure out that there are multiple segments. Is that going to work after renaming the files? Not sure. If it doesn't, you may have to open a bug with Sage to have them address that scenario in the core.

But I think you should be ok as long as you have xxx-0.zzz, xxx-1.zzz, etc. as long as xxx and zzz remain constant in each file name. But, as I say, that's all speculation because I never actually tested this feature when Jeff announced it way back when.

EDIT: So, 'mfadd' should know it has multiple segments when you create it. MediaFileAPI.AddMediaFile() should handle multiple segments when you pass it x-0.y as the file name and there are other files (in the same dir) named x-1.y, x-2.y, etc. That's my understanding from Jeff's explanation when I first read it (a long time ago, 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...

Last edited by Slugger; 05-03-2011 at 02:15 PM.
Reply With Quote
  #799  
Old 05-03-2011, 04:07 PM
bikesquid's Avatar
bikesquid bikesquid is offline
Sage Aficionado
 
Join Date: Jan 2010
Location: California's North Coast
Posts: 392
Quote:
Originally Posted by Slugger View Post
I never actually tested it, but way back when in the early 7.0 betas, I believe, Jeff told us that all you should have to do is link segment 0 to the show and the core will figure out that there are multiple segments. Is that going to work after renaming the files? Not sure. If it doesn't, you may have to open a bug with Sage to have them address that scenario in the core.
Consider it tested and confirmed.
Let the whole script run; rename a couple files, relink the base file and redefine mf based on the new base file name (xxx-0.zzz) and did a .GetNumberOfSegments on that... returned correctly.

I'm not sure I wanted it to work as now I 'have to' add multi-segment logic to all the processes... which is more than I wanted to take on.... Can't wait to see how handbrake responds to this little fir-ball!

Thanks!
Reply With Quote
  #800  
Old 05-07-2011, 03:35 PM
toricred's Avatar
toricred toricred is offline
Sage Icon
 
Join Date: Jan 2006
Location: Northern New Mexico
Posts: 1,729
I'm not doing well searching this thread today. Does somebody have a script for restarting Sage when there's nothing happening? I need this to deal with my Colossi.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 4 (0 members and 4 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 03:38 AM.


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