|
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. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
Programmatically add timed recordings to SageTV?
Hi,
I'm looking for ways to programmatically add recordings to my SageTV server. I've got a custom built application which I use to control my AV gear. From within this application I've also got an EPG view and I'd like to be able communicate to SageTV right from there to create timed recordings at the specified date and the specified channel. The Mobile Web UI provides this functionality for me, since you can easily POST data via HTTP to create timed recordings, but I'm having some issues getting the Mobile Web UI and the XmlTV plugin (which I use alot) to play nice and work simultaneously, like I've described in this thread: http://forums.sagetv.com/forums/showthread.php?t=57387 So my question is, is there some other way I can programmatically create a timed recording? I believe the sageTCPServer plugin provides this functionality since the TiSageTV iOS app can create recordings through it. I'm having a hard time finding any documentation describing it though. I could write my own plugin in java with which I could communicate somehow and the plugin would call the appropriate methods in Sage to create those recordings. I'm also having a hard time finding any API documentation for SageTV. Any ideas for me? What would be the best way? |
#4
|
||||
|
||||
Quote:
RAS Record a show. Type|ShowID Type = type of recording (Manual, FirstRun, ReRun, Any) ShowID = ID of the show.
__________________
SageTCPServer (2.3.5): Open source TCP interface to the SageTV API MLSageTV (3.1.8)/Sage Media Server (1.13): SageTV plugin for MainLobby/CQC TaSageTV (2.58)/TaSTVRemote (1.14): Monitor/control SageTV with an Android device TbSageTV (1.02)/STVRemote (1.11): Monitor/control SageTV with a PlayBook 2 TiSageTV (1.64)/TiSTVRemote (1.09): Monitor/control SageTV with an iPhone/iPod/iPad |
#5
|
|||
|
|||
No, actually I had not seen that page
RAS expects a show ID, if I'm just creating a timed recording at a specified date with a specified duration, how does that work? Also, if Type = Manual, where exactly do I specify the date/time and duration? I've also been reading the API documentation and AiringAPI.SetRecordingTimes seems to do what I want, but it takes in an Airing object. Do I need to create an Airing object first, using the AddAiring method, and then pass that object into SetRecordingTimes? If that's the case, what should I set as the ShowExternalID of the Airing object, since the documentation states that the "Show should already have been added". I'm a little confused .... |
#6
|
||||
|
||||
Typically, the assumption is that SageTV has already built a database, so the ShowID or AiringID can basically be seen as some index in a table. The ShowExternalID is the ID from the original guide data, something like EP1234567890.
In your case, you probably want to use CreateTimedRecording: http://download.sage.tv/api/sage/api...lang.String%29
__________________
SageTCPServer (2.3.5): Open source TCP interface to the SageTV API MLSageTV (3.1.8)/Sage Media Server (1.13): SageTV plugin for MainLobby/CQC TaSageTV (2.58)/TaSTVRemote (1.14): Monitor/control SageTV with an Android device TbSageTV (1.02)/STVRemote (1.11): Monitor/control SageTV with a PlayBook 2 TiSageTV (1.64)/TiSTVRemote (1.09): Monitor/control SageTV with an iPhone/iPod/iPad |
#7
|
|||
|
|||
Thanks, this seems to be exactly what I was looking for :-)
I appreciate your help. |
#8
|
|||
|
|||
Hehe wow, I seem to suck more at Java than I thought
I'm just trying to write a simple test class that calls some functions in SageTV, this is what I have got: import Sage.*; public class CreateRecording { public static void main (String[] args) { //sage.api.Channel channel = sage.api.ChannelAPI.GetChannelForStationID(1); System.out.println("Done"); } } Then I try to compile it using: javac CreateRecording.java I get this error: CreateRecording.java:1: error: package Sage does not exist import Sage.*; ^ 1 error I'm doing this from within the SageTV directory where Sage.jar resides. I'm a complete newbie when it comes to Java, so please be kind |
#9
|
||||
|
||||
First I'd recommend using either Eclipse or Netbeans for an IDE rather than calling the Java compiler directly. There is a small learning curve, but probably less of a learning curve than using the compiler.
Next I'd recommend using the sagex api's by stuckless which provide a nice set of wrappers that make the Sage api's a lot more usable. (They also provide a way to execute the Sage api's remotely but that's another story.) Alternatively you can use GKusnick's api's which provide a strongly typed set of wrappers. If you decide to use sagex the code would look like this: Code:
import sagex.api.*; public class CreateRecording { public static void main (String[] args) { Object channel = ChannelAPI.GetChannelForStationID(1); } }
__________________
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. |
#10
|
|||
|
|||
Hi, just downloaded the Sagex API, this is the file I downloaded:
http://code.google.com/p/customsaget...2.zip&can=2&q= It only containted this file here: sagex-api.jar which I copied to the sagetv/sagetv directory. This is the exact code I'm trying to compile: Code:
import sagex.api.*; public class CreateRecording { public static void main (String[] args) { Object channel = ChannelAPI.GetChannelForStationID(1); System.out.println("Done!"); } } C:\Program Files (x86)\SageTV\SageTV>javac CreateRecording.java CreateRecording.java:1: error: package sagex.api does not exist import sagex.api.*; ^ CreateRecording.java:7: error: cannot find symbol Object channel = ChannelAPI.GetChannelForStationID(1); ^ symbol: variable ChannelAPI location: class CreateRecording 2 errors Still have not tried an IDE ... might try Eclipse soon. Any ideas? |
#11
|
||||
|
||||
The import statement requires that the library (.jar) is somehow included in the project, not sure how you would do that from the command line, as using an IDE is simpler...
__________________
SageTCPServer (2.3.5): Open source TCP interface to the SageTV API MLSageTV (3.1.8)/Sage Media Server (1.13): SageTV plugin for MainLobby/CQC TaSageTV (2.58)/TaSTVRemote (1.14): Monitor/control SageTV with an Android device TbSageTV (1.02)/STVRemote (1.11): Monitor/control SageTV with a PlayBook 2 TiSageTV (1.64)/TiSTVRemote (1.09): Monitor/control SageTV with an iPhone/iPod/iPad |
#12
|
||||
|
||||
Totally agree. Using an IDE (Eclipse or Netbeans) is the way to go. Once you do that there are settings where you tell the IDE where to find the necessary .jar files. I have no clue how to compile using the command line.
__________________
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. |
#13
|
|||
|
|||
Oh that explains it then. My assumption was that the compiler would just pick it up since it was in the class path and I was referring to it with the using statement.
|
#14
|
|||
|
|||
By default, javac only includes that listed in the CLASSPATH environment variable in the classpath. Add -cp argument to javac to get it to compile that file.
__________________
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 |
timed recordings | BKeadle | SageMC Custom Interface | 1 | 06-01-2010 05:23 PM |
Timed Recordings very limited | freedml | SageTV Software | 3 | 05-08-2009 06:43 AM |
Timed Recordings bug in SageTV | ssalah | SageTV Software | 2 | 03-01-2008 02:05 PM |
Timed recordings | rmans | SageTV Recorder Software | 3 | 09-14-2004 11:25 PM |
timed recordings | msm | SageTV Software | 2 | 08-21-2003 08:06 AM |