![]() |
|
Register | Forum Rules | FAQs | Members List | Social Groups | Downloads | Search | Today's Posts | Mark Forums Read |
SageTV Software Discussion related to the SageTV application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the SageTV software application should be posted here. (Check the descriptions of the other forums; all hardware related questions go in the Hardware Support forum, etc. And, post in the customizations forum instead if any customizations are active.) |
![]() |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
Setting padding via API?
I have default padding set within Sage (v9), but when I schedule a recording using the webui, the default padding is always zero and needs to be set manually. That's a bit of an irritation, but I believe that is expected behaviour. If I'm wrong and is there a way of doing automatic padding via the webui, someone please correct me!
However, may main question is - Is there a way of setting the padding for a manual recording and/or a favourite using the Sage API? I'm asking because I control most of my Sage viewing via the Kodi plugin. If there is an API call to set the padding for a scheduled recording, I (think I) could conceivably create a context menu item to at least set the padding with one click. Any advice/suggestions gratefully received. syrel |
#2
|
|||
|
|||
I don't think that there is an API call to just add padding - I think this is dealt with my changing the StopTime parameter in a call to SetRecordingTimes in the Airing API. So to add 30 minutes of airings you would increment StopTime by 1800 (or 1800000 if it is in ms).
see: http://download.sage.tv/api/sage/api...g, long, long) Quote:
__________________
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 |
#3
|
|||
|
|||
Thanks. Hmm, that seems tricky. I'm wondering how I would avoid setting an absolute time in case the epg schedule changes at a later date. Could I potentially send a command that says 'make the start time XX milliseconds before the airing start time?'.
syrel |
#4
|
||||
|
||||
The Favorite API has a SetStartPadding and SetStopPadding, is that what you are looking for?
http://download.sage.tv/api/sage/api...(sage.Favorite, long)
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#5
|
|||
|
|||
Ideally, I'd like it more for manual recordings.
thanks syrel |
#6
|
||||
|
||||
I guess I'm a little confused based on the requirements.
You mention Favorites and Manual Recording (or time based recording). So, if it's a favorite, then you use the FavouriteAPI to adjust the padding. If it's a Manaul Recording (ie, you've said, record this show on this channel at this time) then it's a time based recording the Wayner's response is how you adjust that. I'm not sure what you are asking here if neither of those things are what you need or want ![]() I guess there isn't an api like AdjustPadding(Airing, +/-mins) that will look at the airing and if it's a part of a favorite then it will adjust the favorite, but if if a manual recording it will adjust the scheduled start/end times. Although you could easily add that using the sagex services and javascript and/or you could cleverly create it as well using the EvaluateExpression api and passing a bunch of nested sagetv apis using sagetv's If api.
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#7
|
|||
|
|||
Thanks for replying. I might not be explaining clearly - or it might just be that I'm confused (and confusing)...
Favourites - okay, can see how SetStartPadding works, thanks. Manual record - What I want to be able to do is, having set up a timed record, to send a command that says 'set start [airingtimestart - 5 mins] and set end [airingtimeend + 5 minutes]'. My interpretation of SetRecordingTimes is that it requires me to input a specific/absolute time (i.e. 10.25pm) and not a 'relative to airingtime' number, which could prove a problem if the airingtime changes at all. Or am I misinterpreting SetRecordingTimes? thanks syrel |
#8
|
||||
|
||||
Quote:
So to update an existing airing you'd end up with something like, Code:
SetRecordingsTimes(airing, GetAiringStartTime(ariing)-3*60*1000, GetAringEndTime(airing)+3*60*1000) Now granted, I know very little about Manual Recordings, so I could be completely wrong here ![]()
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#9
|
|||
|
|||
If I remember rightly, if the epg schedule for a manually recorded individual program changes, sage sends an alert telling me that it has re-scheduled the timed record and asks me if that's ok. I guess the question is whether the preset padding also changes - but given that I always set the padding via the webserver and I can't remember a case where this has caused me a problem, I'm guessing it probably does. Anyway, you've given me enough hints that I might be able to make this work. Thanks.
|
#10
|
|||
|
|||
Stuckless, I think what you’re referring to is a timed recording. I think a manual recording is just a way of marking an EPG entry for recording, without making it a favorite. It’s still linked to an airing.
I’m not sure what the timed recording in the GUI does but is suspect it just adds a dummy entry to the schedule without linking to a specific airing. |
#11
|
||||
|
||||
Quote:
I don't think Sage reschedules manual recordings, I'm not sure how it could. When the EPG gets updated, all the sudden that old airing is gone, how is it to know which new airing corresponds to it? |
#12
|
|||
|
|||
Quote:
|
#13
|
|||
|
|||
OK, I've been giving this a go but hit a wall. My command is
/sagex/api?command=SetRecordingsTimes&1=(airing:14903964, GetAiringStartTime(airing:14903964)-2*60*1000, GetAiringEndTime(airing:14903964)+5*60*1000) But I get an 'unknow sage command' error. Full log below. Any ideas? thanks syrel <error sagex-version="7.1.9.1"><message>Unknown Sage Command: SetRecordingsTimes</message><exception>java.lang.RuntimeException: Unknown Sage Command: SetRecordingsTimes at sagex.remote.factory.request.SageRPCRequestFactory.createRequest(SageRPCRequestFactory.java:1211) at sagex.remote.api.ApiHandler.callSageAPI(ApiHandler.java:208) at sagex.remote.api.ApiHandler.handleRequest(ApiHandler.java:150) at sagex.remote.SagexServlet.doPost(SagexServlet.java:87) at sagex.remote.SagexServlet.doGet(SagexServlet.java:41) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:389) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.handler.rewrite.RewriteHandler.handle(RewriteHandler.java:230) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:864) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:539) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520) </exception></error> |
#14
|
||||
|
||||
THere is a few things wrong there...
Apis are called as... c=APINAME&1=arg1&2=arg2... (see /sagex/api for examples of using the API) args CANNOT be expressions. So to do what you want to todo, you need to use the EvaluateExpression command passing a single arg with your complete expressions... /sagex/api?c=EvaluateExpression&1=SetRecordingsTimes(GetAiringForID(14903964), GetAiringStartTime(GetAriingForID(14903964))-2*60*1000, GetAiringEndTime(GetAiringForID(14903964))+5*60*1000) So when calling an API like SetWatched, for example, you can pass 1=mediafile:12312 or 1=airing:123123, etc but you can't pass an expression as the arg. The only API that supports expressions is the EvaluateExpression AND in there you cannot use the "airing:" notation, so you need resolve the airing by ID.
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#15
|
|||
|
|||
Ah, I see. I have much to learn; thanks for the guidance.
syrel |
#16
|
|||
|
|||
I'm beginning to wonder if what I want to do isn't actually possible using SetRecordingTimes:
Just to prove I can get something to work (ie I'm not being completely stupid), I've tried /sagex/api?c=EvaluateExpression&1=GetAiringForID(14903964) /sagex/api?c=EvaluateExpression&1=GetScheduleEndTime(GetAiringForID(14903964)) /sagex/api?c=EvaluateExpression&1=GetScheduleEndTime(GetAiringForID(14903964))-300000 (I've also swapped GetAiringEndTime in place of GetScheduleEndTime and had same results) And all produce the correct response. But when I try /sagex/api?c=EvaluateExpression&1=SetRecordingTimes(GetAiringForID(14903964), GetAiringStartTime(GetAiringForID(14903964))-300000, GetAiringEndTime(GetAiringForID(14903964))+300000 I just get an empty result and nothing changes. syrel |
#17
|
||||
|
||||
It looks like you are missing a bracket at the end
/sagex/api?c=EvaluateExpression&1=SetRecordingTimes(GetAiringForID(14903964), GetAiringStartTime(GetAiringForID(14903964))-300000, GetAiringEndTime(GetAiringForID(14903964))+300000)
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#18
|
|||
|
|||
Thanks again. Yes I had missed off the bracket, but it didn't solve the problem. I've simplified it as much as I can just to get it working:
/sagex/api?c=EvaluateExpression&1=SetRecordingTimes(GetAiringForID(14903964), 1521153300000, 1521157800000) but still nothing. Browser just returns "<Result/>" and no change to the schedule times. syrel |
#19
|
||||
|
||||
Quote:
/sagex/api?c=SetRecordingTimes&1=airing:14903964&2=1521153300000&3=1521157800000 That calls the SetRecordingTimes api directly passing the airing, and the start/end times. Now, the reply for this should either be "true" or an error message.
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#20
|
|||
|
|||
That produces the following error:
<error> <message>Cannot Serialize Reply</message> <class>sage.Catbert$AsyncTaskID</class> <data>sage.Catbert$AsyncTaskID@1e916d8</data> <exception> Cannot Serialize [Field: Result, Type: sage.Catbert$AsyncTaskID ToString: sage.Catbert$AsyncTaskID@1e916d8]</exception> </error> syrel |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
SageTV Not seeing my padding setting | kiddo3110 | SageTV Software | 1 | 08-07-2007 12:42 PM |
padding....yes another question about padding...sorry | kricker | SageTV Software | 8 | 09-25-2005 10:51 PM |
Padding ... :( | snoopy | SageTV Customizations | 2 | 07-20-2005 01:00 AM |
Padding | bgorrell | SageTV Beta Test Software | 1 | 05-03-2004 07:37 AM |
Padding in 2.x.... | JasonJoel | SageTV Beta Test Software | 10 | 04-16-2004 05:36 PM |