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
  #901  
Old 08-25-2011, 10:03 AM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
Quote:
Originally Posted by wayner View Post
Has anyone ever written a script to upload files to a seedbox via ftp? Any suggestion on how to automate an FTP session via script from SJQ? I essentially want to creat an SJQ job that would upload a show to a server via FTP upon completion - perhaps after compressing the show first to save space.
I have developed a process that works pretty well for automatically encoding a file via Handbrake and then uploading that file to an ftp server. This will work from an SJQ task. Currently my code is pretty much all in a batch file, so I guess it will only work on Windows.

But if anyone is interested I can post it here. I may also take Slugger's advice and rewrite the code into Groovy.
__________________
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
Reply With Quote
  #902  
Old 08-31-2011, 05:27 PM
Rob Rob is offline
Sage Expert
 
Join Date: Sep 2003
Posts: 568
I'm trying to use SJQ to un each recording from my R5000's through videoredo's quick stream fix to fix the timeline errors that sometimes occur in my recordings (which cause my extenders to fastforward and make the recording unusable).

I've shamlessly cloned sluggers commsikip test script and bikesquid's videoredo script and made a few mods. Thanks Thanks Thanks. They work great using sagegroovy, but I'm stuck getting them to work with SJQ.

The test script runs fine, waits to the end of the recording and then returns 0;however, I have not been able to get the videoredo script to run.

When I set the task executable in the UI to the videoredo groovy script, I get no log entries for the executable, even when I strip the script down so that all it does is a println.

When I set the executable to the sagegroovy.exe and pass the script as the argument I get a message at the beginning of the log that says "invalid script".

Clearly I am missing something (probably something simple). Can someone educate me as to what it is?

Thanks.
Reply With Quote
  #903  
Old 08-31-2011, 06:03 PM
graywolf's Avatar
graywolf graywolf is offline
Sage Icon
 
Join Date: Oct 2009
Location: NC
Posts: 1,389
can you post your SageTV\SageTV\plugins\sjq-agent\conf\sjqagent.properties file?
Reply With Quote
  #904  
Old 08-31-2011, 06:36 PM
Rob Rob is offline
Sage Expert
 
Join Date: Sep 2003
Posts: 568
Here it is. Thanks.

#Generated by SJQv4 agent
#Wed Aug 31 12:19:18 CDT 2011
task.videoredo.schedule=ON
task.videoredo.testargs=
task.videoredo.rcmin=0
task.videoredo.resources=25
agent.mapdir=
agent.schedule=* * * * *
task.videoredo.maxprocs=2
task.videoredo.exe=c\:\\program files (x86)\\sagetv\\groovy scripts\\sjq videoredo.groovy
task.videoredo.rcmax=0
task.videoredo.maxtime=3600
agent.resources=100
agent.port=23344
task.videoredo.maxtimeratio=1.0
task.videoredo.test=c\:\\program files (x86)\\sagetv\\groovy scripts\\sjq videoredo test script.groovy
task.videoredo.args=
Reply With Quote
  #905  
Old 08-31-2011, 08:56 PM
KarylFStein KarylFStein is offline
Sage Fanatic
 
Join Date: Apr 2006
Location: Westland, Michigan, USA
Posts: 999
Not sure, but I think the *.exe and *.test values need to start with "script\:" e.g. task.videoredo.exe=script\:c\:\\program files (x86)\\sagetv\\groovy scripts\\sjq videoredo.groovy. This is how one of my lines looks, although I use UNC paths: task.comskiptriggerscan.exe=script\://SERVER/Software/SageTV/Scripts/ComskipTriggerScan.groovy.
__________________
Home Network: https://karylstein.com/technology.html

Last edited by KarylFStein; 08-31-2011 at 09:00 PM.
Reply With Quote
  #906  
Old 09-02-2011, 07:45 AM
Rob Rob is offline
Sage Expert
 
Join Date: Sep 2003
Posts: 568
That did the trick. I only needed to add it before the executable and now it runs. Thanks for yourk help!
Reply With Quote
  #907  
Old 09-02-2011, 04:51 PM
graywolf's Avatar
graywolf graywolf is offline
Sage Icon
 
Join Date: Oct 2009
Location: NC
Posts: 1,389
Quote:
Originally Posted by KarylFStein View Post
Not sure, but I think the *.exe and *.test values need to start with "script\:" e.g. task.videoredo.exe=script\:c\:\\program files (x86)\\sagetv\\groovy scripts\\sjq videoredo.groovy. This is how one of my lines looks, although I use UNC paths: task.comskiptriggerscan.exe=script\://SERVER/Software/SageTV/Scripts/ComskipTriggerScan.groovy.
Yep. That is why I asked for the file. I figured it wouldn't have the script value

Glad it's working for you now
Reply With Quote
  #908  
Old 09-02-2011, 06:23 PM
Rob Rob is offline
Sage Expert
 
Join Date: Sep 2003
Posts: 568
Quote:
Originally Posted by graywolf View Post
Yep. That is why I asked for the file. I figured it wouldn't have the script value

Glad it's working for you now
And you were right! It is nice seeing the blue dots beside the completed tasks rather than the red ones.

There was really not alot I had to do to get it working because of all who have gone before me.
Reply With Quote
  #909  
Old 09-12-2011, 10:01 AM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
Maybe I am missing something but as far as I can determine there is no way to see what SJQ tasks have been assigned to a Manual recording and to edit these tasks. If you have forgotten if you have assigned a task how do check this? What I have been doing is deleting the Manual Record and then recreating the Manual Recording. But there has to be a better way.

With Favorites there is the SJQ Actions setting but there doesn't seem to be a counterpart with Manuals.

Am I missing something?
__________________
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
Reply With Quote
  #910  
Old 09-12-2011, 10:38 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by wayner View Post
Maybe I am missing something but as far as I can determine there is no way to see what SJQ tasks have been assigned to a Manual recording and to edit these tasks. If you have forgotten if you have assigned a task how do check this? What I have been doing is deleting the Manual Record and then recreating the Manual Recording. But there has to be a better way.

With Favorites there is the SJQ Actions setting but there doesn't seem to be a counterpart with Manuals.

Am I missing something?
I don't think you're missing anything. I think it was just missed by Tom when he did the STV for it. I doubt any STV updates are coming for SJQ anytime soon, though Tom can correct me.

I'm slowing getting back into coding for Sage again (where the hell did summer go??) and one of my goals is to create the web UI for SJQv4. Is that going to happen? I don't know. If Sage/Google announces something about the next version or the death of this version then that will derail these kinds of plans as well. But as of right now, that's my plan.

As a crude work around, the tasks assigned to a manual recording are stored as properties of the manual recording. One could edit the settings using studio or a standalone groovy script, etc.

Another one of my todo items was to create a generic metadata editor that would allow you to inspect all the metadata defined for an object and then edit it as desired. I even got Jeff to put the req'd API changes in 7.1 for me to do it. Then when Google came along, my interest died on this one as it has for any new plugin ideas that were floating in my head. If I do the web UI for SJQv4 then this metadata editor is a natural addition to 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...
Reply With Quote
  #911  
Old 09-12-2011, 10:40 AM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
Thanks Slugger.
__________________
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
Reply With Quote
  #912  
Old 09-12-2011, 12:27 PM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
Quote:
Originally Posted by Slugger View Post
I don't think you're missing anything. I think it was just missed by Tom when he did the STV for it. I doubt any STV updates are coming for SJQ anytime soon, though Tom can correct me.
Yup, I certainly missed that one. You can create an issue here to remind me: http://code.google.com/p/tmiranda/issues/list
__________________

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
  #913  
Old 09-12-2011, 12:31 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
Quote:
Originally Posted by tmiranda View Post
Yup, I certainly missed that one. You can create an issue
Done-Issue 21
__________________
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
Reply With Quote
  #914  
Old 09-12-2011, 12:33 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
Quote:
Originally Posted by Slugger View Post
Another one of my todo items was to create a generic metadata editor that would allow you to inspect all the metadata defined for an object and then edit it as desired. I even got Jeff to put the req'd API changes in 7.1 for me to do it. Then when Google came along, my interest died on this one as it has for any new plugin ideas that were floating in my head. If I do the web UI for SJQv4 then this metadata editor is a natural addition to it.
This also sounds like a natural extension for the Sage Web UI.
__________________
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
Reply With Quote
  #915  
Old 09-14-2011, 09:45 AM
Jason's Avatar
Jason Jason is offline
Sage Expert
 
Join Date: Nov 2003
Location: Texas
Posts: 598
It appears that bikesquid already asked what I am about to do again, and I did not see the resulting script in Sluggers repo, in the thread for SJQ4 examples nor in the conversation that they they had in the ticket list.

In short, does anyone have a script already done that would move the recorded TV files to a different directory structure based on the Series Name and Episode, keep the associated edl/properties files and ensure that the internal SageTV Database is kept accurate/linked (keeping the watched/dont like/etc status).

I ask in that I am 'playing' with XBMC as a front end and it needs a strict folder structure to utilize the 'library' function of XBMC to scrape it's own metadata.

I would use bradvido's script (within XBMC), but alas, the AppleTV that I am attempting to use as one of the extenders, has problems with following the symlinks that the script generates. I can use his script on every other XBMC install, just not on any Mac based version due to their symlink implementation.


Quote:
Originally Posted by Slugger View Post
The scope of this exercise just got a whole lot bigger. It's not a 30 minute job anymore, but seems like a solid few hours (minimum) to do this and test it properly, which is fine, but can't guarantee it'll even be this week now, but with a ticket I'll definitely eventually do it.
-Jason
__________________
True standalone tuner functionality with the --> HAVA Channel Changer<--
Reply With Quote
  #916  
Old 09-14-2011, 10:55 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by Jason View Post
It appears that bikesquid already asked what I am about to do again, and I did not see the resulting script in Sluggers repo, in the thread for SJQ4 examples nor in the conversation that they they had in the ticket list.

In short, does anyone have a script already done that would move the recorded TV files to a different directory structure based on the Series Name and Episode, keep the associated edl/properties files and ensure that the internal SageTV Database is kept accurate/linked (keeping the watched/dont like/etc status).

I ask in that I am 'playing' with XBMC as a front end and it needs a strict folder structure to utilize the 'library' function of XBMC to scrape it's own metadata.

I would use bradvido's script (within XBMC), but alas, the AppleTV that I am attempting to use as one of the extenders, has problems with following the symlinks that the script generates. I can use his script on every other XBMC install, just not on any Mac based version due to their symlink implementation.




-Jason
Send bikesquid a PM, he ended up finishing the script on his own. As a starting point:

http://sagetv-addons.googlecode.com/...ia_file.groovy

That script at least finds and moves media files... you could mod it to rename based on season/episode, etc. Of course, that's exactly what bikesquid did so I'd definitely try to reach him via PM first to see if he's willing to share what he has.
__________________
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
  #917  
Old 09-14-2011, 01:12 PM
Jason's Avatar
Jason Jason is offline
Sage Expert
 
Join Date: Nov 2003
Location: Texas
Posts: 598
Quote:
Originally Posted by Slugger View Post
Send bikesquid a PM, he ended up finishing the script on his own.
Did that before I even posted...

I was hoping that someone else would have thought/done the same thing already. Considering what a PITA XBMC is to use in regards to the scraping requisites, I would have thought that this would have been 'commonly' done.

My hope is that I can get a great (1080i) client with the ATV1. I would use the Boxee client on it as well, but Boxee does not allow the use of the CrystalHD card that I installed, whereas XBMC does.

Sorry to go off topic there...

-Jason
__________________
True standalone tuner functionality with the --> HAVA Channel Changer<--
Reply With Quote
  #918  
Old 09-14-2011, 04:14 PM
Rob Rob is offline
Sage Expert
 
Join Date: Sep 2003
Posts: 568
I have two questions.

First. In a groovy script the following lines:

def path = SJQ4_METADATA.get("SJQ4_PATH")
def segment = SJQ4_METADATA.get("SJQ4_MAX_SEGMENT_INDEX")
def name = SJQ4_METADATA.get("SJQ4_LAST_SEGMENT_NAME")
def extension = SJQ4_METADATA.get("SJQ4_LAST_SEGMENT_TYPE")
println path
println segment
println name
println extension

produce an output of:

null
null
null
mpg

I am not understanding why the type is available, but the others are not. All four variables show up fine on the "Completed Tasks" Display option of the GUI.

Second. Originally the task was set (via the gui) to execute on the start of a program. I changed it to execute at the stop of a program. Now it executes both times. How do I fix it to do only one and which is the "best practice".

Last edited by Rob; 09-14-2011 at 09:34 PM.
Reply With Quote
  #919  
Old 09-15-2011, 03:53 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by Rob View Post
I have two questions.

First. In a groovy script the following lines:

def path = SJQ4_METADATA.get("SJQ4_PATH")
def segment = SJQ4_METADATA.get("SJQ4_MAX_SEGMENT_INDEX")
def name = SJQ4_METADATA.get("SJQ4_LAST_SEGMENT_NAME")
def extension = SJQ4_METADATA.get("SJQ4_LAST_SEGMENT_TYPE")
println path
println segment
println name
println extension

produce an output of:

null
null
null
mpg

I am not understanding why the type is available, but the others are not. All four variables show up fine on the "Completed Tasks" Display option of the GUI.
Will need to see a full script that reproduces this along with the details from metadata table in the SJQ4 database for the task id being executed plus the server and task client log files for the task run.

Quote:
Second. Originally the task was set (via the gui) to execute on the start of a program. I changed it to execute at the stop of a program. Now it executes both times. How do I fix it to do only one and which is the "best practice".
Did you uncheck the job from the RecordingStarted event list? You'd have to uncheck it from there after checking it on the RecodingStopped event list.
__________________
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
  #920  
Old 09-16-2011, 08:09 AM
Rob Rob is offline
Sage Expert
 
Join Date: Sep 2003
Posts: 568
Thanks for the reply Slugger. For the first issue I found the problem. Me Typical USER ERROR.

Of course the variables are not availble when running the script outside of SJQ.....

I'm still getting the task run on recording start and recording stop. When I go to the screen to assign tasks to events, it always opens with recording start selected. If I change to recoding stop and close the screen, when I return it shows recoding start again. Is there a way to change this in a properties file instead of relying on the screen?

New question. For multi segment recordings, after looping through the segments and running video redo on each, is there a way to attach all the segments (files) to a single sage mediafile. In the API, I see the method for adding a new mediafile with a single java.io.file, but no method for adding it with an array of files or a method for adding segments to an existing media file. What am I missing here?
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.