|
SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here. |
|
Thread Tools | Search this Thread | Display Modes |
#281
|
||||
|
||||
Quote:
Another question regarding the API. Is the SetWatchedTimes command supported? I believe I am calling it correctly, but I am not seeing the times updated when I view the data after calling the update. I don't really know how to tell if it's really working, because the return type is void. Anyway, here's the command I'm trying to use to say "I started watching this show on 01/02/2011 18:00:05 [represented as 1294012805000] and I am 30 seconds into it [represented as 30000]". Code:
http://192.168.88.10:8080/sagex/api?c=SetWatchedTimes&1=airing:121074&2=30000&3=1294012805000 |
#282
|
||||
|
||||
The second parameter is an Airing-relative time, so you'll need to add your 30,000 to the time the airing started recording. To get that value, call the GetScheduleStartTime API.
To check your results, call the GetLatestWatchedTime API. And remember that your new value will be ignored if the existing latest watched time is later than the new time you're passing in. I think the airing is set to "watched" if the latest watched time is within a given range of the end of the show, and the latest watched time value is reset if you clear the watched status of the airing.
__________________
Server: Intel Core i5 760 Quad, Gigabyte GA-H57M-USB3, 4GB RAM, Gigabyte GeForce 210, 120GB SSD (OS), 1TB SATA, HD HomeRun. Extender: STP-HD300, Harmony 550 Remote, Netgear MCA1001 Ethernet over Coax. SageTV: SageTV Server 7.1.8 on Ubuntu Linux 11.04, SageTV Placeshifter for Mac 6.6.2, SageTV Client 7.0.15 for Windows, Linux Placeshifter 7.1.8 on Server and Client, Java 1.6. Plugins: Jetty, Nielm's Web Server, Mobile Web Interface. |
#283
|
||||
|
||||
Quote:
Here's an XML snippet from GetAiringForID call: Code:
http://192.168.88.10:8080/sagex/api?c=GetAiringForID&1=121074 <ScheduleStartTime>1294012800000</ScheduleStartTime> <ScheduleEndTime>1294016400000</ScheduleEndTime> <ScheduleDuration>3600000</ScheduleDuration> <IsWatched>false</IsWatched> <WatchedDuration>0</WatchedDuration> <WatchedStartTime>0</WatchedStartTime> <WatchedEndTime>0</WatchedEndTime> <RealWatchedStartTime>0</RealWatchedStartTime> <RealWatchedEndTime>0</RealWatchedEndTime> <LatestWatchedTime>1294012800000</LatestWatchedTime> <IsWatchedCompletely>false</IsWatchedCompletely> <AiringID>121074</AiringID> I'm trying to setting it to: 1294014600000 (30 minutes later) So, I call this command to say I started watching it at the schedule start time, and I watched it for 30 minutes past that: Code:
Parameters explained: 1 = airing:121074 (the airing identifier) 2 = 1294014600000 (WatchedEndTime, airing relative, 30 minutes past the schedule start time) 3 = 1294012800000 (RealStartTime, set to the same as the schedule start time) The call: http://192.168.88.10:8080/sagex/api?c=SetWatchedTimes&1=airing:121074&2=1294014600000&3=1294012800000 The result: <Result /> Can you see anything that I am missing? Last edited by bradvido; 01-31-2011 at 02:51 PM. |
#284
|
||||
|
||||
@bradvido - have you tried to do this using the expression evaluator in studio? maybe it's the args... maybe it's something to do with sagex remote apis??
__________________
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 |
#285
|
||||
|
||||
No. I don't have studio and have never used it (so far). Will that give me more debugging info?
|
#286
|
||||
|
||||
Not that it will give any more detail... it will just take sagex-apis out of the equation and allow you to test the native api, just to see if sagex is somehow causing the issue.
__________________
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 |
#287
|
||||
|
||||
AFAIK I'm the only one who has used this. Jeff added it for me to use in the iOS streaming.
I'm not familiar with all its nuances. If your latest watched time is within the start padding time it may have no effect. You might also try adding your time to the value returned by GetAiringStartTime or GetFileStartTime and compare the results. I thought you wanted 30 seconds which is why I suggested 30,000 ms. If you want 30 minutes, use 30*60*1000.
__________________
Server: Intel Core i5 760 Quad, Gigabyte GA-H57M-USB3, 4GB RAM, Gigabyte GeForce 210, 120GB SSD (OS), 1TB SATA, HD HomeRun. Extender: STP-HD300, Harmony 550 Remote, Netgear MCA1001 Ethernet over Coax. SageTV: SageTV Server 7.1.8 on Ubuntu Linux 11.04, SageTV Placeshifter for Mac 6.6.2, SageTV Client 7.0.15 for Windows, Linux Placeshifter 7.1.8 on Server and Client, Java 1.6. Plugins: Jetty, Nielm's Web Server, Mobile Web Interface. |
#288
|
||||
|
||||
bradvido, try this out. I was able to get it working in Studio's expression evaluator. I had a nice write-up prepared but my computer crashed, so you get the short version
Code:
SetWatchedTimes(Airing, GetAiringStartTime(Airing) + 30*60*1000, GetRealWatchedStartTime(Airing))
__________________
Server: Intel Core i5 760 Quad, Gigabyte GA-H57M-USB3, 4GB RAM, Gigabyte GeForce 210, 120GB SSD (OS), 1TB SATA, HD HomeRun. Extender: STP-HD300, Harmony 550 Remote, Netgear MCA1001 Ethernet over Coax. SageTV: SageTV Server 7.1.8 on Ubuntu Linux 11.04, SageTV Placeshifter for Mac 6.6.2, SageTV Client 7.0.15 for Windows, Linux Placeshifter 7.1.8 on Server and Client, Java 1.6. Plugins: Jetty, Nielm's Web Server, Mobile Web Interface. |
#289
|
|||
|
|||
Some questions about "custom services":
1) Is the .js file (re)loaded each time when a function is called? I ask because if I overwrite the file it picks up the changes without reloading the web server (and I have turned off the constant check for new files in jetty). I would be concerned about a lot of disk reads if this is the case. 2) json for custom objects: I have tried to return a custom object and it fails to encode as json because it is not a Sage object. I can construct the json string manually but it is wrapped in "Result" XML tags (not a big deal but an extra "layer" that is not necessary). Is there a better way to do this? Thanks.
__________________
-Craig |
#290
|
||||
|
||||
Quote:
2. The return types are basically Strings and Serializable save objects. The main encoder simply takes the result and then converts it into Xml or Json. If you return JSONObject, I'm not quite sure what will happen, but I suspect it will break. When you call a service, you specify the encoding of either xml or json. So if you return a String that is json data, it will simply be assigned the "result" in the returning object, as a string, and not as json data. To be honest, no one has ever played with this (except for myself) so there's been very little enhancements. Unfortunately the timing isn't good for me right now, but if you have the java experience to make the services better by natively supporting json/xml, etc, I'd certainly review the patch.
__________________
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 |
#291
|
|||
|
|||
Quote:
__________________
-Craig |
#292
|
||||
|
||||
Quote:
But for your needs, you can probably "simulate" a json reply using lists, arrays, and maps. ie, if in the sagex service that you create, you create a java.util.HashMap and fill it with named data, then it will look like a json object in the reply. I'm pretty sure the sagex apis will serialize maps, lists and arrays, since many of the sage apis natively return those types. If you want the reply to be sent back as json, then set the json encoder in the request url (by default it uses the xml encoder)
__________________
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 |
#293
|
|||
|
|||
Using a string works just fine for this. My concern is with the .js file constantly being reloaded since this custom service will be called a lot. Would there be any way to optionally keep the .js file loaded until a restart of jetty?
__________________
-Craig |
#294
|
||||
|
||||
It can certainly be changed... but i didn't do it that way, so that you wouldn't need to restart sagetv everytime your made a change to the script. Maybe what the service code needs is a "test" flag that when sent, it will recompile the script... but under normal use it would only do it once.
__________________
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 |
#295
|
|||
|
|||
If you could add that at some point it sounds perfect. Thanks.
__________________
-Craig |
#296
|
||||
|
||||
Security Change in next release Sagex Services
By default, /sagex/api will have a security handler and will require the same user/passwrd that also protects bmt, and neilm's webserver.
I did a search of the plugins and I didn't find any plugins that depend on sagex-services directly, which is the plugin that exposed the sagex apis over http/rmi, so this change may not affect anyone. There were 28 plugins that depend on sagex-api, so if you are depending on sagex-api but really doing it to use the http services, then you'll be affected. This update will probably be rolled out sometime tomorrow.
__________________
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 |
#297
|
|||
|
|||
Quote:
|
#298
|
||||
|
||||
Yeah, it will be basic auth... but, you'll have the ability to turn off the authentication, if you want. It's just that out of the box it will require user/pass. I am only locking down the /sagex/api and not the media handlers.
__________________
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 |
#299
|
||||
|
||||
Quote:
__________________
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 |
#300
|
||||
|
||||
Revisit of UIContext
I saw some info in the thread regarding using UIContext in Get/SetProperty() to make sure the data was actually written to the correct .properties file but it was old and I'd like to revisit the issue.
If I use SetProperty(UIContext.SAGETV_PROCESS_LOCAL_UI, "Name", "Value") from within my Java code will that write the property to the correct place or do I need to get the UIContext Name and then use SetProperty(new UIContext(UIContextName), "Name", "Value")?
__________________
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. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Hauppauge Remote Issue | yacht_boy | Hardware Support | 4 | 05-01-2008 09:25 PM |
MCE remote transmitting keypresses twice | arnabbiswas | Hardware Support | 1 | 02-22-2007 10:55 AM |
MCE Remote not work fully with Placeshifter | devinteske | SageTV Placeshifter | 5 | 02-08-2007 11:45 PM |
Harmony Remote IR Reciever Help | brundag5 | Hardware Support | 2 | 01-13-2007 09:08 PM |
How to get SageTV to release focus to NVDVD for remote | IncredibleHat | SageTV Software | 4 | 07-06-2006 07:47 AM |