|
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. |
|
Thread Tools | Search this Thread | Display Modes |
#1461
|
|||
|
|||
Don't think so. That should about do it.
__________________
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... |
#1462
|
|||
|
|||
When I tried to run sagegroovy on the new PC I get a Java error but the Groovy Console starts and it looks like I am able to run code, including Java code.
Here is the error: Code:
java.utils.prefs.WindowsPreferences <init> WARNING: Could not open/create prefs root node Software\Javasoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
__________________
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 |
#1463
|
|||
|
|||
Is that the Oracle JVM installed? I've never seen that before, but definitely isn't caused by anything in the SageGroovy code.
__________________
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... |
#1464
|
|||
|
|||
I have just installed the basic java from the Oracle web site - this is a new PC so it hasn't had too much software installed. The OS is Win7 Pro x64 - when I Google this it seems to be very prevalent on 64 bit installs so maybe it related to that. It may also be related to not running Sagegroovy as an administrator, although the account is an administrator account. But adding this reg key solves the problem.
__________________
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 |
#1465
|
|||
|
|||
Quote:
I wrote a vb script to email me a daily hard drive report - this is run once a day from Task Scheduler on my SageTV server. The email looks like this if all is well: Code:
Subject: Daily Hard Drive Report - all is well Hard drive report for CARNOUSTIE C: drive 42.561 GB free of 119.240 GB The threshold for this report is: 15 GB lobs folder size is: 0.013 GB This is a vbscript code and it calls on another routine to send an email via my gmail account (if anyone wants that script then let me know): Code:
Dim fso, drv, bytesPerGB, freeGB, totalGB, s Set fso = CreateObject("Scripting.FileSystemObject") Set WshNetwork = CreateObject("WScript.Network") s = "" bytesPerGB = 1024 * 1024 * 1024 ComputerName = WshNetwork.ComputerName LowDriveThreshold=15 LobsFolderName="C:\Program Files\SageTV\SageTV\.lobs.db" Set LobsFold=fso.GetFolder(LobsFolderName) LobsSize=FormatNumber(LobsFold.Size/bytesPerGB,3) Drive="c:\" Set drv = fso.GetDrive(fso.GetDriveName(Drive)) s = s & drv.Path & " drive " if drv.IsReady Then freeGB = drv.FreeSpace / bytesPerGB totalGB = drv.TotalSize / bytesPerGB s = s & FormatNumber(freeGB, 3) + " GB free of " s = s & FormatNumber(totalGB, 3) + " GB" Else s = s & "Not Ready" End If If freeGB < LowDriveThreshold then Subject="*******HARD DRIVE ALERT**********" Else Subject="Daily Hard Drive Report - all is well" End If 'Subject="Hard Drive Report" Body="Hard drive report for "+ComputerName+vbCRLF+vbCRLF+s+vbCRLF+"The threshold for this report is: "+Cstr(LowDriveThreshold)+" GB" +vbCRLF Body = Body + "lobs folder size is: "+Cstr(LobsSize)+" GB" Recipient="bill.gates@microsoft.com" Script = "gmail.vbs" Set objshell = CreateObject("WScript.shell") strCmd = Script &" "& Recipient &" """ &Subject&""" """ & Body &"""" result = objShell.Run( strCmd, 1, True)
__________________
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 |
#1466
|
|||
|
|||
@slugger - Where would you suggest I go to find more info regarding formatting for Groovlets? I have found that you can't just use your normal Groovy code as for some reason line breaks don't show up in web pages. So it appears that you have to use stuff like <p> on every line.
Where do I learn more about this? Or is there an easier way to do this, like dumping all of the output to a text file (or a large string) and then just outputting the text file to the web page?
__________________
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 |
#1467
|
|||
|
|||
Well the quickest way to get around this would be if it's just plain text you're always outputting then set the content type header in the response to text/plain. The "best" solution depends on what you're doing and how you're doing it.
For general Groovlet type stuff, just google J2EE servlets, which are the Java equivalent then from there focus on Groovlets to learn the "groovy shortcuts" available within Groovlets. But if you have a groovy script that outputs plain text and you want the "poor man's way" to convert that to a groovlet for use in the webui, then just add a single line that sets the content type header and you should be good to go. Create a test.groovy file in webserver/groovy/ on your system. Put this in it: Code:
response.setHeader('Content-Type', 'text/plain') 100.times { println it } Now if you want the webui look & feel, menus, etc. along with the script's output, well then you need to wrap the output within the webui templates and that's a whole other direction requiring way more time and teaching than I have to give today. Though this should help you if you're trying to go in that direction.
__________________
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; 02-22-2014 at 11:59 AM. |
#1468
|
|||
|
|||
Some weird stuff going on... I am getting different behavior on IE11, IE10 and Chrome.
Initially when I tried to access test.groovy web page with the code above from a very new PC with win7x64 and IE11 it thinks you are trying to download a file and asks if you want to Open or Save test.groovy. If you say open then it gives you a text file opened in Notepad. It does not do that when you comment out the setHeader line. So something is f'ed up in IE11 or in my IE11 config for text/plain files On another PC running IE10 and on Chrome on either PC I didn't have these issues and I am getting the expected output - number 1-100 either on one line or separate lines. When I change the content type to text/html I don't get the dialog in IE11 but I do get everything on one line in all browser, IE10,11 and Chrome. Weird...
__________________
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 |
#1469
|
|||
|
|||
Quote:
Yes, that's weird, most browsers don't download text/plain, they just display it in the browser. IE11 is the exception if that's the default or some setting's been changed to cause it. I mean the other fix, which is a little less ideal is to: Code:
response.setHeader('Content-Type', 'text/html') // This is the default so is redundant in this case; only set if not using text/html println '<html><head><title>Test Page</title></head><body><pre>' 100.times { println it } println '</pre></body></html>'
__________________
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; 02-22-2014 at 03:12 PM. |
#1470
|
|||
|
|||
I just got around to applying your updates of the web UI and SJQ web UI from a few weeks ago and I am having a problem.
When I click on any of the SJQ menu items in the Web UI I get a 404 Not found error such as: Problem accessing /sage/sjq4.groovy. Reason: NOT_FOUND But it looks like the file it should be accessing is /sage/sjq/sjq4.groovy Any reason why I would be getting this error? I upgraded the Web UI, ignored the restart Sage as I then immediately updated the SJQ Web UI and then restarted the Sage service. What do you mean in the description for the SJQ web UI where you say "Load it via the /sage/sjq/sjq4.groovy URI in your SageTV web UI" And I don't see any of the JVM stuff. The webserver jar is dated Jan 27 and the footer reports version 2.42. The down arrows on the menu items have disappeared and I now see kind of a drop shadow effect. Here are the files that I see in the webserver/groovy/sjq directory: Code:
01/26/2014 05:47 PM 1,611 ajax.groovy 01/26/2014 06:07 PM 6,629 sjq4.groovy 01/15/2012 04:56 PM 4,000 sjq4_clients.gsp 01/15/2012 04:56 PM 1,019 sjq4_crontab.gsp 01/15/2012 04:56 PM 1,539 sjq4_c_mod.gsp 01/15/2012 04:56 PM 4,203 sjq4_c_task_edit.gsp 01/15/2012 04:56 PM 1,131 sjq4_events.gsp 01/15/2012 04:56 PM 287 sjq4_log.gsp 01/15/2012 04:56 PM 590 sjq4_menu.gsp 01/26/2014 05:51 PM 3,774 sjq4_queue.gsp 01/15/2012 04:56 PM 4,065 sjq4_view.gsp
__________________
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 |
#1471
|
|||
|
|||
Sounds like your browser is caching the old files. Force a reload of the site via Shift+Refresh in Chrome/FF or Ctrl-Refresh (I think) in IE. Or go to your browser settings and clear your cache.
Might also be a plugin installation problem with the Sage core. Go to SageTV/jetty/webapps/nielm_sagewebserver/webapp/ In there is a file called ddmenu.txt. Have a look at it, you should see references to the new menu items (Restart Sage, Run GC, etc.). If not, the plugin didn't update properly, if so then it's a browser cache issue.
__________________
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... |
#1472
|
|||
|
|||
Frackin' caches! That was the problem.
__________________
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 |
#1473
|
|||
|
|||
From within a Sage job that runs on my server I want to queue up a Sage Job on a remote client - is there any well to tell in Groovy if the client is alive before I try to submit the job? Within the Sage UI I can ping it or see the green circle, but how do I tell this from code?
__________________
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 |
#1474
|
|||
|
|||
Quote:
Anyway, the javadocs for the SJQv4 stuff are here: http://sagetv-addons.sourceforge.net/javadocs/sjq/ And a quick browse of those found this, which is probably what you'll need: http://sagetv-addons.sourceforge.net...shared.Client) Although, you don't really need to verify if a client is alive before submitting a job. The queue will hold the job until a client capable of running it is available.
__________________
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... |
#1475
|
|||
|
|||
I just want to be safe to see if the client is alive as I look to do my encoding on my fastest PC.
Maybe I am dumb at reading documentation but why do I get "No such property ServerClient" with the following code: Code:
import com.google.code.sagetvaddons.* println ServerClient.getAllClients().toString()
__________________
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 |
#1476
|
|||
|
|||
Quote:
__________________
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... |
#1477
|
|||
|
|||
Ok, this works:
Code:
import com.google.code.sagetvaddons.sjq.network.ServerClient ServerClient clnt= new ServerClient() clients= clnt.getAllClients() println clients clnt.close() [Client[host=Carnoustie:23344,state=ONLINE,lastUpdate=2014-02-23 15:03:21.483], Client[host=192.168.1.95:23344,state=ONLINE,lastUpdate=2014-02-23 15:03:22.181], Client[host=192.168.1.93:23345,state=ONLINE,lastUpdate=2014-02-23 15:04:20.169]] I guess I just now have to figure out how to work with these clients.
__________________
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 |
#1478
|
|||
|
|||
Quote:
Code:
import com.google.code.sagetvaddons.sjq.shared.* import com.google.code.sagetvaddons.sjq.network.* // Let's see if client '192.168.0.100:23344' is online def svr = new ServerClient() println svr.getAllClients().find { it.host == '192.168.0.100' && it.port == 23344 && it.state = Client.State.ONLINE }.size() == 1 svr.close() ** I don't need to look because I'm assuming my Client class is written in my standard fashion of getters and setters. Honestly, I actually did peek at the javadocs just to make sure my example is actually right, and it is.
__________________
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; 02-23-2014 at 03:05 PM. Reason: Shame on me... always close the server connection! ;) |
#1479
|
|||
|
|||
Metaprogramming
Like I said, groovy opens up so many cool little tricks. Now cool is subjective, and perhaps only the computer scientists/software engineers in the crowd will think this stuff is cool, but if nothing else it's powerful.
Take the example code in my last post. If what you're working on is somewhat large or you're going to need to determine if a client is online in many places in whatever you're working on then wouldn't it be nice if you could just ask a client if it's online instead of having to use that closure all over the place (or creating some function in your script that refactors the check)? The SJQv4 API doesn't provide these features (as the javadocs show), but with groovy you can dynamically extend an API at run time, even APIs for which you don't have the source code available! This is truly groovy! Code:
import com.google.code.sagetvaddons.sjq.shared.* import com.google.code.sagetvaddons.sjq.network.* // Add some helpers to the SJQv4 API ServerClient.metaClass.isClientRegisteredAndOnline = { String host, int port -> getAllClients().find { it.host == host && it.port == port && it.online } != null } Client.metaClass.isOnline { -> delegate.state == Client.State.ONLINE } // Done metaprogramming -- GROOVY!! def svr = new ServerClient() // So now to find out if a specific server is online, it's simple svr.isClientRegisteredAndOnline('sagetv2', 23345) // Now Client instances all have a boolean property to determine if they're online svr.getAllClients().each { println "$it.host:$it.port is ${it.online ? '' : 'not'}online!" } svr.close()
__________________
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... |
#1480
|
|||
|
|||
Thanks Slugger, I am/was an engineer so I find this stuff cool. But I am away in Whister for a week so I wouldn't get a chance to delve into it any further for a few days.
The reason for doing this is to have file pre-processed on my server and the. Legit hand heavier encoding tasks off to a faster CPU that can use QuickSync for encoding to mp4. My newest CPU with QuickSync is 10X faster and the encoding.
__________________
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 |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
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 |