|
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 |
#1
|
|||
|
|||
Using sagex with phoenix views
Is there any way to use the sagex http interface and return media items belonging to a phoenix view?
For example, I create a custom phoenix view of all my blu-rays rated PG or lower and I want to use sagex to return me a list of all the media id's within that custom view. I've been looking through the documentation, searching the forums and googling for quite a while now with no luck. I'm beginning to think it's not possible. Thanks for the help!
__________________
Server: AMD Phenom II X6 3.20 GHz ♠ 16 GB RAM (15.7 usable) Capture: HDHomeRun PRIME ♠ Ceton InfiniTV 4 PCIe (Clear-QAM only) Tuning: OpenDCT v0.5.20-RC2 Software: Windows 7 Ultimate 64-bit ♠ SageTV v9.0.12.504 ♠ Java 1.8.0_111 Clients: 4 x STX-HD300 ♠ 3 x STX-HD200 ♠ MacOS Placeshifter |
#2
|
|||
|
|||
I'm sure it's possible... the Phoenix for Android does it somehow, as does BMT.
You probably have to make a call to the phoenix api (Phoenix API Summary) but I don't really know how to do that... |
#3
|
|||
|
|||
I'm guessing BMT and Phoenix for Android are using the the Java API's.
I'm in an iOS household, except for one old Android phone in a cabinet somewhere. So I would like to create a simple web application that has a very small subset of Phoenix for Android functionality. Basically, my WebApp will be able to display any Phoenix view along with cover art for each item and click for more details and trailer functionality. I had already embarked on learning how to implement infinite scrolling when I stumbled up Phoenix for Android and saw someone beat me to the punch. So..I will continue on my quest for an iOS or web-app version of the above. However, the first step is getting the MediaFileID's for each video in various Phoenix views. The first step is often the hardest I suppose!
__________________
Server: AMD Phenom II X6 3.20 GHz ♠ 16 GB RAM (15.7 usable) Capture: HDHomeRun PRIME ♠ Ceton InfiniTV 4 PCIe (Clear-QAM only) Tuning: OpenDCT v0.5.20-RC2 Software: Windows 7 Ultimate 64-bit ♠ SageTV v9.0.12.504 ♠ Java 1.8.0_111 Clients: 4 x STX-HD300 ♠ 3 x STX-HD200 ♠ MacOS Placeshifter |
#4
|
||||
|
||||
Normal SageTV apis are accessed via the /sagex/api, phoenix apis are accessed via sagex/phoenix.
If you look at this python script (written for my Plex Channel) you'll get the idea of how to use the phoenix apis. Code:
https://github.com/stuckless/sagetv-phoenix-plex-channel/blob/master/SageTVPhoenix.bundle/Contents/Services/Shared%20Code/sagex.pys Code:
http://HOST:PORT/sagex/phoenix?c=phoenix.umb.CreateView&1=phoenix.view.util.recentrecordings The reply is json object that contains a "reply" node with the reply contents.
__________________
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
|
|||
|
|||
That's exactly what I was looking for stuckless, thank you.
Now I'm just a little stuck with getting my .ajax call to work. I'm not sure if it is a "remote server" issue or not. My SageTV Jetty server port is 8009, while my webapp is going served via IIS on port 80. The following code results in a parsing error on the response (I believe do to the function name missing in the jsonp response...json is coming back instead of a jsonp response): Code:
function getViewFromSageTV(viewName) { var api_url = "http://192.168.1.80:8009/sagex/phoenix"; $.ajax({ url: api_url, type: "GET", dataType: "jsonp", jsonp: "jsoncallback", data: { c: "phoenix.umb.CreateView", 1: viewName }, beforeSend: function() { alert("Sending"); $("#ajaxload").show(); }, success: function (result) { if (result.reply != null) { viewModel.totalTitles(result.reply.id); alert("Success"); $("#ajaxload").hide(); } }, error: function (jqXHR, textStatus, errorThrown) { $("#error").show(); $("#error").append(textStatus + " | " + errorThrown + " | "+ jqXHR.status + " | " + jqXHR.statusText + " | " + jqXHR.responseText); //alert("Failed"); } }); } I've also tried the following urls ( result in a 404) as per the information found here: https://code.google.com/p/customsagetv/wiki/JsonRPC http://192.168.1.80:8009/sagex/rpcJs...=1395449173935 http://192.168.1.80:8009/sagex/jsonR...=1395449222565 I also tried the sample code found on the JsonRPC Wiki, but it results in a 404 on the .ajax call. I've also included a second screen shot of Fiddler showing the HTTP call to sagex and the raw response coming back. It shows the function wrapper missing from the expected jsonp response. Is this a bug in the sagex api?
__________________
Server: AMD Phenom II X6 3.20 GHz ♠ 16 GB RAM (15.7 usable) Capture: HDHomeRun PRIME ♠ Ceton InfiniTV 4 PCIe (Clear-QAM only) Tuning: OpenDCT v0.5.20-RC2 Software: Windows 7 Ultimate 64-bit ♠ SageTV v9.0.12.504 ♠ Java 1.8.0_111 Clients: 4 x STX-HD300 ♠ 3 x STX-HD200 ♠ MacOS Placeshifter |
#6
|
|||
|
|||
Hmmm. So it looks like by calling the Phoenix API from sagex we lose jsonp functionality. A non-Phoenix call to sagex of:
Code:
http://192.168.1.80:8009/sagex/api?c=GetNumberOfPlaylistItems&1=playlist:Showing&jsoncallback=dan Code:
dan({"Result":3}) I forked the sagex code from github last night so I could take a look in more detail. I found where the jsoncallback parameter is evaluated and the response wrapped by the function. I ran out of time before I could find where sagex wraps the phoenix api to determine if what I need is even possible.
__________________
Server: AMD Phenom II X6 3.20 GHz ♠ 16 GB RAM (15.7 usable) Capture: HDHomeRun PRIME ♠ Ceton InfiniTV 4 PCIe (Clear-QAM only) Tuning: OpenDCT v0.5.20-RC2 Software: Windows 7 Ultimate 64-bit ♠ SageTV v9.0.12.504 ♠ Java 1.8.0_111 Clients: 4 x STX-HD300 ♠ 3 x STX-HD200 ♠ MacOS Placeshifter |
#7
|
||||
|
||||
Yeah, unfortunately, I never did implement for jsonp for the phoenix apis... which is more of an oversight than anything else.
__________________
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 |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
upgraded phoenix & stv, now views not loading | JonTom | Phoenix | 13 | 05-09-2013 04:55 PM |
sagex-api - how can I tell if it works? | gveres | SageTV v7 Customizations | 2 | 01-27-2012 10:56 PM |
User Categories in Phoenix views | Fuzzy | Phoenix | 4 | 01-02-2012 09:19 AM |