SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Customizations
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

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.

Reply
 
Thread Tools Search this Thread Display Modes
  #41  
Old 12-05-2008, 10:43 AM
mikwilli mikwilli is offline
Sage User
 
Join Date: Nov 2008
Posts: 30
Brent,
For me I have a several reasons. Probably the biggest is that I enjoy coding and this is a challenge. Second is that I have SageTV on a computer connected to a TV, but the other TVs in my house which are not directly connected to it have Xboxes. While its true you can watch any of the recorded shows easily from the Xboxes you don't get the episode information, video format (So you know if its possible to watch through Xbox), etc. Also with this I'll have the ability to browse through the TV listings, set up recordings, etc.

Also since my other TVs are all STD Def using my existing xbox hardware is much cheaper than a media extender or small computer attached to them.

Hope this helps.
Reply With Quote
  #42  
Old 12-05-2008, 10:46 AM
Brent Brent is offline
SageTVaholic
 
Join Date: May 2006
Location: KC, Missouri
Posts: 3,695
Quote:
Originally Posted by mikwilli View Post
Hope this helps.
It does and it makes sense too. Thanks!
Reply With Quote
  #43  
Old 12-05-2008, 11:01 AM
kricker's Avatar
kricker kricker is offline
Sage Icon
 
Join Date: Jan 2005
Location: Knoxville, TN
Posts: 1,137
Send a message via AIM to kricker Send a message via MSN to kricker
Quote:
Originally Posted by Brent View Post
Ok. Sorry to pollute this thread buy I have to ask you guys in the know.

Why would you go through this trouble? What do you like with XBMC that you don't about SageTV. And what do you need from SageTV that you aren't getting from XBMC...

I'm a curious one - especially about HTPC software.
It's a matter of taste, just like anything. Best for you to try it out yourself and see how it fits into your HTPC wants/needs.

3rd party win32 builds
Grab Jester's latest win32 build from his link. It has native SMB support for windows.
Reply With Quote
  #44  
Old 12-05-2008, 11:05 AM
mikwilli mikwilli is offline
Sage User
 
Join Date: Nov 2008
Posts: 30
Well I just can't figure out what the problem is. The code is a cakewalk but its not returning what it should. For the node in question the dump is;
Type: ELEMENT_NODE
Name: objectRef
Value: None
Type: ATTRIBUTE_NODE
Name: ref
Value: 27805663
Type: TEXT_NODE
Name: #text
Value: 27805663

but running this which works elsewhere doesn't work on this node
value = node.getAttribute('ref')

value stays as an empty string. From the dump we can see that an attribute called ref exists and the extraction command can't get any simpler so I am not sure what the issue is. Google has failed me

For reference I have no trouble using the same command and getting a result with this node:
Type: ELEMENT_NODE
Name: arrayRef
Value: None
Type: ATTRIBUTE_NODE
Name: ref
Value: 9246537
Type: TEXT_NODE
Name: #text
Value: 9246537
Type: ATTRIBUTE_NODE
Name: size
Value: 2
Type: TEXT_NODE
Name: #text
Value: 2

Last edited by mikwilli; 12-05-2008 at 11:16 AM. Reason: more info
Reply With Quote
  #45  
Old 12-05-2008, 11:21 AM
mikwilli mikwilli is offline
Sage User
 
Join Date: Nov 2008
Posts: 30
Argh, I knew it was something simple and boneheaded. I was calling the unlink command for the dom before processing the command. The nodelist I had was getting smashed by the garbage cleanup. All I had to do was wait to do gc until after the call.
Reply With Quote
  #46  
Old 12-05-2008, 11:31 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
mikwilli, Glad you figured it out

And Brent, much like mikwilli response to your xbmc, I have 1 main TV where I have the HD extender, but I also have 2 other TVs in the house that get used less frequently. On one I have a MVP, and on the other I have a Xbox. So having a script like this for the rare times I do use the xbox is great.
Reply With Quote
  #47  
Old 12-05-2008, 05:46 PM
mikwilli mikwilli is offline
Sage User
 
Join Date: Nov 2008
Posts: 30
I really like this API. It is able to provide point pieces of information really quickly. I did find though that once I had it ramped up to grab all the needed pieces for the search window though that it was doing 16 http calls per item and so a search of my recorded shows made over 200 HTTP calls which turned out to be too slow. What I am doing is a hybrid approach. I will use this API to get the information quickly like AiringID or MediaFileID, then use the webserver XML for broader information. It should be the most optimal solution. I was going to look into JSON, but it looks like it is supported in Python 2.6 and the latest Atlantis build of XBMC is still using 2.4

I will update later next week with (hopefully) a working copy to try out.
Reply With Quote
  #48  
Old 12-05-2008, 06:10 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
I'll put some thought into this as well. I had a couple of ideas around the making request calls that would return more information. For example, once you have a media file ref, you could make a call that would return all/most information about media item in a single call. Unfortunately, been busy working on some other stuff lately
Reply With Quote
  #49  
Old 12-07-2008, 12:11 PM
jhh jhh is offline
Sage Advanced User
 
Join Date: Nov 2003
Location: BE
Posts: 196
Quote:
Originally Posted by stuckless View Post
This script looks pretty cool. I'm a long time XMBC fan, but I've recently had to let it go, since it does not support mpeg4 HD (at least not on the xbox).
The webserver supports re-encoding/streaming on the fly - if you have a powerhorse as a server you could consider doing so and the xbmc could then show the re-encoded content.

As an alternative you could build a windows/linux box with XBMC on as the limitations are XBOX related and most likely not XBMC.

Just me trying to keep SageTV interested developers on the platform
Reply With Quote
  #50  
Old 12-07-2008, 01:09 PM
jreichen's Avatar
jreichen jreichen is offline
Sage Icon
 
Join Date: Jul 2004
Posts: 1,192
Quote:
Originally Posted by stuckless View Post
I'll put some thought into this as well. I had a couple of ideas around the making request calls that would return more information. For example, once you have a media file ref, you could make a call that would return all/most information about media item in a single call. Unfortunately, been busy working on some other stuff lately
You probably already know this, but nielm created a DTD for the XML documents that the web server creates. That's one format you could use to return larger data sets.
__________________
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.

Reply With Quote
  #51  
Old 12-07-2008, 02:04 PM
mikwilli mikwilli is offline
Sage User
 
Join Date: Nov 2008
Posts: 30
One thing I found interesting though was that the DTD did not seem to contain all the pieces you find on the web pages. For instance I was not able to find isArchived. Since its not in the XML and not in the sage.api that I can find (It may well be there and I am missing it) I am unsure if this is something that is no longer applicable.

stuckless,
I loaded up your SVN trunk into eclipse and was poking around. Its got a lot of good stuff in it. I was thinking that really all that may be needed would be to cast the objects back into the Sage pieces like sage.Airing, etc. I wasn't able to find these object definitions in the Sage.jar though. Any idea where they are housed?
Reply With Quote
  #52  
Old 12-07-2008, 02:16 PM
jreichen's Avatar
jreichen jreichen is offline
Sage Icon
 
Join Date: Jul 2004
Posts: 1,192
Quote:
Originally Posted by mikwilli View Post
One thing I found interesting though was that the DTD did not seem to contain all the pieces you find on the web pages. For instance I was not able to find isArchived. Since its not in the XML and not in the sage.api that I can find (It may well be there and I am missing it) I am unsure if this is something that is no longer applicable.
There isn't an isArchived function in the Sage api. Instead, it's
Code:
isTVFile && isLibraryFile
__________________
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.

Reply With Quote
  #53  
Old 12-07-2008, 02:27 PM
mikwilli mikwilli is offline
Sage User
 
Join Date: Nov 2008
Posts: 30
Ah, thanks for the info. Is there a doc that I should be reading instead of posting? I know there is a Studio doc is this info there?
Reply With Quote
  #54  
Old 12-07-2008, 03:18 PM
jreichen's Avatar
jreichen jreichen is offline
Sage Icon
 
Join Date: Jul 2004
Posts: 1,192
Andy created a sticky for Studio Information Resources. That has several links to helpful documentation.

I usually open an existing STV in Studio to see how to do things. I'm no Studio expert, but I can follow the code well enough to find out how to do something.

Other Java plugins are also good places to look. The first thing I worked on was nielm's webserver and learned a lot from looking through its code.

If your intent is to use this thread for user support, it's probably a good idea to ask development questions elsewhere so users don't have to filter through them to find answers to their questions. The SageTV Studio forum is a good place to post questions about development.
__________________
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.

Reply With Quote
  #55  
Old 12-07-2008, 05:00 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
You probably already know this, but nielm created a DTD for the XML documents that the web server creates. That's one format you could use to return larger data sets.
Actually I didn't know this , but I would think that if niem's server already supports sending back large chunks, then there wouldn't really be a need for me to do it as well... at least not in the same format. Anything that I would do, would either be done via a generator, or custom templated on the fly. I'll explain...

I'd either generate replies that represent object items, much like greg does in his API, and then serialize them back as XML or JSON. The other approach would be to allow a user to pass reply object template during the request, and then just have the reply code, fill in the blanks so to speak.

mikwilli, regarding the APIs... The APIs that I created mirrors the ficticous APIs that Sage documents. You can't get a concrete sage object that represents a media file, etc, but you can get an object that you then call services against. It's actually because of the services nature of the Sage API, that making a remote API was quite easy. If you want to work in Java, then you can use my java wrappers, which work like how Sage documents their API, or you can use Greg's wrappers (from the studio tools project) which works more like traditional objects.
Reply With Quote
  #56  
Old 12-07-2008, 05:34 PM
mikwilli mikwilli is offline
Sage User
 
Join Date: Nov 2008
Posts: 30
Ok cool. This was great information. Really the webserver would be perfect for this XBMC python script except for 2 things. First is that the xml does not respond to the pagelen argument. So that means that when I request the recorded progs, scheduled progs, EPG info, etc. It always passes the full list. Since Xboxes are just P3s with limited memory this makes the script too slow. The second issue is that the order by/sort by commands are not honored by the xml.

So what ends up happening is that to grab say the last 5 recorded programs I end up processing everything. I'll check the code that was pointed out which should give me some hints as to what may be possible that I am currently unaware of. Either way I think it wouldn't be too hard to add some extra pieces which would do the bulk of the sorting/processing on the bigger server side instead of at the Xbox.
Reply With Quote
  #57  
Old 12-07-2008, 07:39 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
It always passes the full list. Since Xboxes are just P3s with limited memory this makes the script too slow
Have you looked in using a SAX parser instead of a DOM parser? I tend to use SAX for xml files that are quite large. It's a little hard to work with at first, but once you get used to SAX, it's actually quite good. I used to DOM parsing for everything, but lately I've been using SAX, and it is quite fast and uses very little memory.
Reply With Quote
  #58  
Old 12-08-2008, 03:22 PM
mikwilli mikwilli is offline
Sage User
 
Join Date: Nov 2008
Posts: 30
stuckless,
I didn't realize that the SAX parser was faster. I will check into using it. Also I added a new Handler to your Sage API. It doesn't touch any existing code aside from sagex.remote.SagexServlet which allows it to be called. The handler basically just doesn't make remote references. If its a primitive or array of primatives is prints them out in the value tags. Same with strings. If its a sage object then it calls the SageXMLWriter that Nielm wrote in sagexmlinfo. So far it is working well. I am adding in sorting and length limiting. If it seems viable I will pass on the code to you to determine if its something you want to include or not.
Reply With Quote
  #59  
Old 12-08-2008, 04:40 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Sounds good... can't wait to see it. BTW.... i the current serializer does actually send back primitive and arrays of primitives.... arrayRef is and objectRef are only returned for Sage objects that can't be serialized.

SageXMLWriter sounds like a good choice. Was this what jreichen was referrerring to in an earlier post? If so, then I didn't catch the full reference.
Reply With Quote
  #60  
Old 12-09-2008, 02:09 AM
jreichen's Avatar
jreichen jreichen is offline
Sage Icon
 
Join Date: Jul 2004
Posts: 1,192
Quote:
Originally Posted by mikwilli View Post
stuckless,
I didn't realize that the SAX parser was faster. I will check into using it.
It can be much faster and require less memory. But it can also be tricky to code because it is event-based and you have to track where you're at in the document. Plus it always parses the whole document. You can choose to ignore events after you find what you need, but the parser still runs through the whole document.

In Java, there is a newer parser type known as StAX (Streaming API for XML). .NET has something similar, but I'm not sure whether Python has it. It's efficient like a SAX parser because it doesn't build a DOM tree, but easier to code because you have more control over the parsing by asking for the next item when you're ready for it (it's a "pull" parser rather than a "push" parser). You can also stop the parsing when you find what you need (by not asking for any more items). Just an alternative for you to consider.

Quote:
Originally Posted by stuckless View Post
SageXMLWriter sounds like a good choice. Was this what jreichen was referrerring to in an earlier post? If so, then I didn't catch the full reference.
Yes, the web server uses nielm_sagexmlinfo.jar to create the XML docs. It also contains the DTD I mentioned.
__________________
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.

Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 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
Any interest in a plugin to support/control the Sony XL1B firewire DVD changer? TerryMathews SageTV Customizations 74 07-21-2011 02:24 PM
MediaPlayer Plugin/STV Import: Winamp Media Player Plugin deria SageTV Customizations 447 12-11-2010 07:38 PM
XBMC plugin for SageTV jhh SageTV Customizations 45 04-19-2009 01:16 PM
VMC's MyNetFlix Plugin in SageTV - WOOHOO! osburnfamily SageTV Customizations 8 06-17-2008 11:54 PM
STV Import: Weather Monitor deria SageTV Customizations 35 08-23-2006 08:15 PM


All times are GMT -6. The time now is 08:18 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.