|
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 |
#1221
|
||||
|
||||
I just "finished" the following code and would like to solicit feedback as to whether I'm even close. For example, is it even possible to do an IF, followed by several ELSE's? Even if the code is wrong, I think it's pretty clear what I'm attempting to do. Don't laugh too hard, guys! I don't do this regularly.
Rather than the CODE tag, I used PHP, since the tabs were reflected accurately. PHP Code:
__________________
Server: XP, SuperMicro X9SAE-V, i7 3770T, Thermalright Archon SB-E, 32GB Corsair DDR3, 2 x IBM M1015, Corsair HX1000W PSU, CoolerMaster CM Storm Stryker case Storage: 2 x Addonics 5-in-3 3.5" bays, 1 x Addonics 4-in-1 2.5" bay, 24TB Client: Windows 7 64-bit, Foxconn G9657MA-8EKRS2H, Core2Duo E6600, Zalman CNPS7500, 2GB Corsair, 320GB, HIS ATI 4650, Antec Fusion Tuners: 2 x HD-PVR (HTTP tuning), 2 x HDHR, USB-UIRT Software: SageTV 7 |
#1222
|
|||
|
|||
I tried to correct your unbalanced { }, but I don't have access to a groovy parser at this exact moment to confirm my edits are 100% accurate, but I think they're at least closer to valid. I also inlined some comments on the code.
The script looks relatively sound to me... I'd probably refactor some of the common code for easier maintenance, but nothing I'd worry about for now (and so I didn't mention any of that in my comments). Code:
// I'm fairly certain your parenthesis don't match up, I don't have access to a groovy parser at the moment so // this may still not be right, but I'm fairly certain what you pasted is invalid; I tried to fix it with the naked eye Object mediaFile = MediaFileAPI.GetMediaFileForID(SJQ4_METADATA.get("SJQ4_ID").toInteger()) String channel = AiringAPI.GetAiringChannelName(mediaFile) /* Building the file name from the SJQ env vars is fine, but you already have the media file object so you might find it easier/more reliable to use the MediaFileAPI functions to extract the file name. But then again, if this is working for you then that's fine. */ String file = SJQ4_METADATA.get("SJQ4_PATH") + SJQ4_METADATA.get("SJQ4_LAST_SEGMENT") String fileType = SJQ4_METADATA.get("SJQ4_LAST_SEGMENT_TYPE") if(channel ==~ /WABCDT|WCBSDT|WNBCDT|WPIXDT|SYFYHD|TNTHD|USAHD|SPIKEHD|FXHD/) { println "Running PRIMARYHDSKIP" println file // You don't have to worry about quoting args, etc. if you build a command array // def command = ['C:/comskip/comskip.exe', '--ini=C:/comskip/comskit-PRIMARYHD.ini', file].execute() def command = "\"C:/comskip/comskip.exe\" --ini=C:/comskip/comskip-PRIMARYHD.ini \"${file}\"".execute() command.consumeProcessOutput() // Are you sure you don't want to capture the output for possible debugging? consumeProcessOutput(System.stdout, System.stderr) will capture it in SJQ logs command.waitFor() if (command.exitValue()) return 1 else return 0 } else if(channel ==~ /WNYWDT/) { println "Running WYNWDTSKIP" println file def command = "\"C:/comskip/comskip.exe\" --ini=C:/comskip/comskip-WNYWDTSKIP.ini \"${file}\"".execute() command.consumeProcessOutput() command.waitFor() if (command.exitValue()) return 1 else return 0 } else if(channel ==~ /HSTRYHD/) { println "Running HSTRYHDSKIP" println file def command = "\"C:/comskip/comskip.exe\" --ini=C:/comskip/comskip-HSTRYSKIP.ini \"${file}\"".execute() command.consumeProcessOutput() command.waitFor() if (command.exitValue()) return 1 else return 0 } else if(channel !=~ /WNYWDT|WABCDT|WCBSDT|WNBCDT|WPIXDT|SYFYHD|TNTHD|USAHD|SPIKEHD|FXHD|HSTRYHD|HBO.*|ACMAXHD|5MAXHD|HDNETMV|MAX.*|MOMAX|STZ.*|ENC.*|SHO.*|TMC.*|PPV.*/) { println "Running PRIMARYHDSKIP (Default)" println file def command = "\"C:/comskip/comskip.exe\" --ini=C:/comskip/comskip-PRIMARYHDSKIP.ini \"${file}\"".execute() command.consumeProcessOutput() command.waitFor() if (command.exitValue()) return 1 else return 0 } else { println 'Not running comskip for this recording!' return 0 }
__________________
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... |
#1223
|
|||
|
|||
The only thing I see is that comskip's error level is backwards. So if comskip returns a 1 you need to return a 0 to SJQ and visa versa.
__________________
Server: i5 8400, ASUS Prime H370M-Plus/CSM, 16GB RAM, 15TB drive array + 500GB cache, 2 HDHR's, SageTV 9, unRAID 6.6.3 Client 1: HD300 (latest FW), HDMI to an Insignia 65" 1080p LCD and optical SPDIF to a Sony Receiver Client 2: HD200 (latest FW), HDMI to an Insignia NS-LCD42HD-09 1080p LCD |
#1224
|
|||
|
|||
Right... actually isn't 0 OR 1 valid for comskip (pretty sure that's right). So just adjust the if statements appropriately (another reason to refactor )
__________________
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... |
#1225
|
||||
|
||||
Can SJQ wake up a machine?
I want to move to a 64 bit system to gain more memory. I have one firewire box that needs 32 bit. So I was thinking of moving that to a standalone
32 bit machine and using it as a network encoder, if possible (But that's a different question in a different thread). If that works, I don't necessarily want to have this 32 bit machine on 24/7. I'd like to only turn it on when it needs this other tuner. Does SJQ have the ability to sniff what tuners are needed coming up so it could act and wake up the 32 bit system? Thanks! Long live Sage! Jim |
#1226
|
|||
|
|||
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... |
#1227
|
||||
|
||||
Quote:
__________________
Server: XP, SuperMicro X9SAE-V, i7 3770T, Thermalright Archon SB-E, 32GB Corsair DDR3, 2 x IBM M1015, Corsair HX1000W PSU, CoolerMaster CM Storm Stryker case Storage: 2 x Addonics 5-in-3 3.5" bays, 1 x Addonics 4-in-1 2.5" bay, 24TB Client: Windows 7 64-bit, Foxconn G9657MA-8EKRS2H, Core2Duo E6600, Zalman CNPS7500, 2GB Corsair, 320GB, HIS ATI 4650, Antec Fusion Tuners: 2 x HD-PVR (HTTP tuning), 2 x HDHR, USB-UIRT Software: SageTV 7 |
#1228
|
||||
|
||||
Quote:
This might be more trouble than it's worth... Maybe I can just run a SJQ script to check if there ever is a conflict and then send me an e-mail and I can turn it on manually... Or.. Maybe I'll try to run a 32 machine in a VM and then I don't have to worry about it being on 24/7.. hmm... Or.. Give up on Firewire recording and just rely on my 3 prime tuners and 2 HDHR tuners for locals... |
#1229
|
|||
|
|||
Failed Tasks, Unsure Why
Just in the past day my tasks (which have been previously working fine) have been failing. I've attached a screenshot of the beginning of the log file. I haven't knowingly changed anything (I running Windows XP) and I tried rebooting, but the problems persists. Should I reinstall Java? I'm at a loss.
Last edited by gdippel; 09-22-2012 at 09:22 AM. |
#1230
|
|||
|
|||
The sagex remote API plugin is not functioning properly. I saw there was an update for that plugin earlier this week. Did you apply that update? If so, did you restart Sage after doing so? If you did restart Sage and that didn't help then I'd start looking at that plugin. If that plugin isn't working then SJQ task clients cannot function.
__________________
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... |
#1231
|
|||
|
|||
I seemed to have missed that plugin update. I just installed it and I now have a running task. Slugger, thanks for the quick reply. I should probably setup your groovy script that checks for plugin updates.
BTW, this goes to show how invaluable this forum is for Sage users. I know this has been discussed before, but is there some contingency plan should this forum cease? I'm sure Jeff will give us some advance notice, but it would be nice to be prepared to start a sub forum on, say, the AVS site. |
#1232
|
|||
|
|||
Here's another side benefit to SJQv4.
My server is on a UPS but one of my clients running SJQv4 client is not. If I get a power flash it causes the PC to reboot which causes the SJQ client to go offline. This triggers a Sage warning and with SageAlert I get an email telling me that the client is offline which means that I have lost power (or my PC has crashed).
__________________
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 |
#1233
|
|||
|
|||
Is it possible to Power Off an extender via Groovy code within SJQv4? You can do this from the Sage Web server but I couldn't find the relevant command in the Sage API.
__________________
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 |
#1234
|
|||
|
|||
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... |
#1235
|
|||
|
|||
Groovy Update: Notes for SJQv4 Users
By the end of this weekend, you will notice a new update for the Groovy plugin. If you upgrade the web server UI later this weekend (when that update becomes available), you will have Groovy updated for you as part of that update.
This update moves Groovy from 1.7 to 2.0. Though a significant jump, it shouldn't have a major effect on the majority of users. The only issue users may run into is the use of private fields in your scripts. Groovy 2.0 is more strict about the use of private fields (and methods) in scripts (and in general). I don't suspect this is an issue for most SJQ users, but I'm bringing it to your attention. If you're affected by this you'll know it because your tasks and/or test scripts will suddenly start to fail. The error spit out by Groovy should be sufficient to fix things up quickly, but if not then post issues here. The move to 2.0 opens up some interesting doors, should I choose to ever tackle my todo/wish list for SJQ at some point. One of the major milestones in even beginning to start on the list was a required upgrade to Groovy 2.0. My work on the Schedules Direct plugin has kind of forced my hand and so here we are. Am I ever going to actually tackle the list? Very unlikely at this point, but with the upgrade to Groovy 2.0, the possibility is at least a little more likely today.
__________________
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... |
#1236
|
|||
|
|||
Can you elaborate on this a wee bit? Any chance of you doing any improvements/enhancements to the Web server? For example it would be nice to at least provide a link in the web server menus to the SJQ groovy page that allows you to manage SJQ via the web server. It would also be nice to be able to see your Java heap status from the web interface.
__________________
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 |
#1237
|
|||
|
|||
Quote:
Additional web server enhancements: I'd like to, but it's not priority. Honestly, in an ideal world, I'd never release another build of the web server. Just wanting to upgrade Groovy from 1.7 to 2.0 was a nightmare, mostly of my own doing, but a nightmare none the less. Three or four solid evenings lost on figuring out how to get newer versions of Groovy working with the Groovy support in the web UI. As I said, the issues were all my own doing, which is why I'd rather not touch anything that is happily working. But in this case, I really wanted Groovy 2.0 for the new Schedules Direct plugin so I had to bite the bullet, which is why you're getting a new web UI build (already in the repo). I have no plans for any further web UI builds at this point. The SJQ menu would be ideal and if I had remembered before delivering today's build I would have added it, but I didn't. Instead, I made a bookmark in my browser long ago to "solve" that 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... |
#1238
|
|||
|
|||
Quote:
With respect to the web UI - is this something that a user (like me) can easily adapt ourselves. It would also be nice to link to other user defined Groovy web processes - currently I have to do that by building my own 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 |
#1239
|
|||
|
|||
Quote:
Alternatively, you could mod the menu file in the exploded directory that the app runs from, but that's not good because everytime Sage and/or the web ui and/or jetty is restarted then your mods are clobbered. At one point I started working on the ability to load user edits to the menu from a separate file, but that didn't come about for reasons I can't remember (there were technical roadblocks slowing me down so I didn't bother to finish 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... |
#1240
|
|||
|
|||
Well, it's your lucky day! There just happened to be a bug with the web based plugin manager that I really wanted fixed. Since I was doing another build, I took the time to rip out the old js menu and replaced it with a new one and set it up so users can inject custom items into the menu. An SJQ Web UI update should be in the repo shortly that injects the SJQ menu into the web UI.
__________________
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... |
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 |