SageTV Community  

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

Notices

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.

Reply
 
Thread Tools Search this Thread Display Modes
  #221  
Old 07-18-2010, 09:56 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
Sean,

That fixed it. Thanks.

Tom
__________________

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.
Reply With Quote
  #222  
Old 10-07-2010, 06:48 AM
broconne broconne is offline
Sage Aficionado
 
Join Date: Feb 2009
Location: Cary, NC
Posts: 306
Logo

Is it possible to get the Channel Logo using the remote API?

I read the docs and searched this thread - but couldn't figure out how to do it. When I do what I think is the correct thing by looking at the API, I get the following error:

Code:
 curl "http://10.0.0.11:8080/sagex/api?c=GetLogo&1=WTVDDT"
<error sagex-version="7.0.15.0"><message><![CDATA[Unknown Object Type: sage.cx for Sage Object: MetaImage[C:\Program Files\SageTV\SageTV\ChannelLogos\WTVDDT.png#0 264x198 javaImage=false javaMem=0 jref=0]]]></message><exception><![CDATA[java.lang.Exception: Unknown Object Type: sage.cx for Sage Object: MetaImage[C:\Program Files\SageTV\SageTV\ChannelLogos\WTVDDT.png#0 264x198 javaImage=false javaMem=0 jref=0]
        at sagex.remote.builder.SimpleXmlBuilder.handleError(SimpleXmlBuilder.java:38)
        at sagex.remote.builder.SageAPIBuilder.build(SageAPIBuilder.java:63)
        at sagex.remote.api.XmlReplyEncoder.encodeReply(XmlReplyEncoder.java:26)
        at sagex.remote.api.ApiHandler.hanleRequest(ApiHandler.java:158)
        at sagex.remote.SagexServlet.doPost(SagexServlet.java:63)
        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.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)
Caused by: java.lang.Exception: Unknown Object Type: sage.cx for Sage Object: MetaImage[C:\Program Files\SageTV\SageTV\ChannelLogos\WTVDDT.png#0 264x198 javaImage=false javaMem=0 jref=0]
        ... 23 more
I see one post in here about how to get thumbnails using the /media method. Is there a similar method for channel logos?
Reply With Quote
  #223  
Old 10-07-2010, 07:17 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by broconne View Post
Is it possible to get the Channel Logo using the remote API?

I read the docs and searched this thread - but couldn't figure out how to do it. When I do what I think is the correct thing by looking at the API, I get the following error:

Code:
 curl "http://10.0.0.11:8080/sagex/api?c=GetLogo&1=WTVDDT"
<error sagex-version="7.0.15.0"><message><![CDATA[Unknown Object Type: sage.cx for Sage Object: MetaImage[C:\Program Files\SageTV\SageTV\ChannelLogos\WTVDDT.png#0 264x198 javaImage=false javaMem=0 jref=0]]]></message><exception><![CDATA[java.lang.Exception: Unknown Object Type: sage.cx for Sage Object: MetaImage[C:\Program Files\SageTV\SageTV\ChannelLogos\WTVDDT.png#0 264x198 javaImage=false javaMem=0 jref=0]
        at sagex.remote.builder.SimpleXmlBuilder.handleError(SimpleXmlBuilder.java:38)
        at sagex.remote.builder.SageAPIBuilder.build(SageAPIBuilder.java:63)
        at sagex.remote.api.XmlReplyEncoder.encodeReply(XmlReplyEncoder.java:26)
        at sagex.remote.api.ApiHandler.hanleRequest(ApiHandler.java:158)
        at sagex.remote.SagexServlet.doPost(SagexServlet.java:63)
        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.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)
Caused by: java.lang.Exception: Unknown Object Type: sage.cx for Sage Object: MetaImage[C:\Program Files\SageTV\SageTV\ChannelLogos\WTVDDT.png#0 264x198 javaImage=false javaMem=0 jref=0]
        ... 23 more
I see one post in here about how to get thumbnails using the /media method. Is there a similar method for channel logos?
Unfortunately, no. I have not added support for channel logos, although it would actually be fairly easy to do, and an extension of the media handler.
Reply With Quote
  #224  
Old 10-07-2010, 07:28 AM
broconne broconne is offline
Sage Aficionado
 
Join Date: Feb 2009
Location: Cary, NC
Posts: 306
Quote:
Originally Posted by stuckless View Post
Unfortunately, no. I have not added support for channel logos, although it would actually be fairly easy to do, and an extension of the media handler.
Ok - Thanks. I submitted a request for enhancement on the project site. Thanks for providing these APIs.
Reply With Quote
  #225  
Old 10-07-2010, 07:33 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by broconne View Post
Ok - Thanks. I submitted a request for enhancement on the project site. Thanks for providing these APIs.
Thanks. My time is pretty thin lately, but I'll see if I can quickly add in support for channel logos over the weekend.
Reply With Quote
  #226  
Old 10-16-2010, 04:45 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
A little later than I had hoped... but I've updated the sagex-apis to 7.0.19, and there is a media handler for getting logos. You can use it like,

/sagex/media/logo/LOGONAME

If there is a logo, it will call GetLog(LOGONAME) and return the image, if it exists.
Reply With Quote
  #227  
Old 10-16-2010, 05:50 AM
broconne broconne is offline
Sage Aficionado
 
Join Date: Feb 2009
Location: Cary, NC
Posts: 306
Quote:
Originally Posted by stuckless View Post
A little later than I had hoped... but I've updated the sagex-apis to 7.0.19, and there is a media handler for getting logos. You can use it like,

/sagex/media/logo/LOGONAME

If there is a logo, it will call GetLog(LOGONAME) and return the image, if it exists.
Thanks for adding this!
Reply With Quote
  #228  
Old 10-20-2010, 08:18 PM
broconne broconne is offline
Sage Aficionado
 
Join Date: Feb 2009
Location: Cary, NC
Posts: 306
Stuckless -
Thanks again for these awesome remote APIs. I do come with another question and an RFE :-)

Question: Does /media support cover art for music? I have music that has cover art, but I don't seem to be able to get it with /thumbnail - should I be able to?

RFE: If a media file does not exist, could the handler for the /media set the response code to 404 instead of 200?
__________________
Host: ESXi 6.5 w/ Intel Core i7 2.8GHZ 8GB Ram
Guest: Ubuntu 16.04 with Sage v9 in Docker
Tuners: 2 HDHR (OTA);
Extenders: HD300 connected to a Samsung 56" DLP HDTV; HD300 connected to a Sharp 42" LCD
Storage: OmniOS w/6 1TB Samsung Spinpoint in a RaidZ2 configuration in a 20 bay SATA hotswap case.
Reply With Quote
  #229  
Old 10-20-2010, 08:28 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by broconne View Post
Stuckless -
Thanks again for these awesome remote APIs. I do come with another question and an RFE :-)

Question: Does /media support cover art for music? I have music that has cover art, but I don't seem to be able to get it with /thumbnail - should I be able to?

RFE: If a media file does not exist, could the handler for the /media set the response code to 404 instead of 200?
Never personally handled music but I think you want the Album Api more specifically GetAlbumArt() for music

cheers
Reply With Quote
  #230  
Old 10-21-2010, 06:02 AM
broconne broconne is offline
Sage Aficionado
 
Join Date: Feb 2009
Location: Cary, NC
Posts: 306
Quote:
Originally Posted by PLUCKYHD View Post
Never personally handled music but I think you want the Album Api more specifically GetAlbumArt() for music

cheers
I think when using the remote API, I need to invoke one of the /media handlers if I want an actual image returned to me, at least that is how it worked for logos and video thumbnails. Under the covers, it will be resolving the request into an Album object, and then extracting the image from the resulting sage.MetaImage and returning that.

But I am just speculating - I am sure stuckless can end the speculation.
__________________
Host: ESXi 6.5 w/ Intel Core i7 2.8GHZ 8GB Ram
Guest: Ubuntu 16.04 with Sage v9 in Docker
Tuners: 2 HDHR (OTA);
Extenders: HD300 connected to a Samsung 56" DLP HDTV; HD300 connected to a Sharp 42" LCD
Storage: OmniOS w/6 1TB Samsung Spinpoint in a RaidZ2 configuration in a 20 bay SATA hotswap case.
Reply With Quote
  #231  
Old 10-21-2010, 06:21 AM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by broconne View Post
I think when using the remote API, I need to invoke one of the /media handlers if I want an actual image returned to me, at least that is how it worked for logos and video thumbnails. Under the covers, it will be resolving the request into an Album object, and then extracting the image from the resulting sage.MetaImage and returning that.

But I am just speculating - I am sure stuckless can end the speculation.
Curious why you need the actual image as Studio just needs the sage.MetaImage to work. I call GetThumbnail and such all the time in sagex and display in studio without invoking any of the media handlers.

Are you doing something to the image in java?
Reply With Quote
  #232  
Old 10-21-2010, 06:29 AM
broconne broconne is offline
Sage Aficionado
 
Join Date: Feb 2009
Location: Cary, NC
Posts: 306
Quote:
Originally Posted by PLUCKYHD View Post
Curious why you need the actual image as Studio just needs the sage.MetaImage to work. I call GetThumbnail and such all the time in sagex and display in studio without invoking any of the media handlers.

Are you doing something to the image in java?
I am requesting the image using HTTP to the jetty servlet for use in a C# application. I am building a free driver for Elve (Home automation software) to connect to Sage.
__________________
Host: ESXi 6.5 w/ Intel Core i7 2.8GHZ 8GB Ram
Guest: Ubuntu 16.04 with Sage v9 in Docker
Tuners: 2 HDHR (OTA);
Extenders: HD300 connected to a Samsung 56" DLP HDTV; HD300 connected to a Sharp 42" LCD
Storage: OmniOS w/6 1TB Samsung Spinpoint in a RaidZ2 configuration in a 20 bay SATA hotswap case.
Reply With Quote
  #233  
Old 10-21-2010, 06:57 AM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by broconne View Post
I am requesting the image using HTTP to the jetty servlet for use in a C# application. I am building a free driver for Elve (Home automation software) to connect to Sage.
Okay gotcha now
Reply With Quote
  #234  
Old 10-21-2010, 07:23 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by broconne View Post
I think when using the remote API, I need to invoke one of the /media handlers if I want an actual image returned to me, at least that is how it worked for logos and video thumbnails. Under the covers, it will be resolving the request into an Album object, and then extracting the image from the resulting sage.MetaImage and returning that.

But I am just speculating - I am sure stuckless can end the speculation.
The /media/ handler is essentially a "Fanart" handler. Which is why it supports /poster, /background, etc. I don't have fanart for music items, yet.

But, the default handler /thumbnail/ should actually work for music, as long as GetMediaFileImage return an image for a music item.

I think that when I add music support, i'll probably need a specialized /music handler to support getting covers and possibly artists.

And I agree, the, /media handlers (all handlers actually) should return a 404 if the images does not exist.

I've added 2 issues for these requests.
Reply With Quote
  #235  
Old 10-21-2010, 07:44 AM
broconne broconne is offline
Sage Aficionado
 
Join Date: Feb 2009
Location: Cary, NC
Posts: 306
Quote:
Originally Posted by stuckless View Post
The /media/ handler is essentially a "Fanart" handler. Which is why it supports /poster, /background, etc. I don't have fanart for music items, yet.

But, the default handler /thumbnail/ should actually work for music, as long as GetMediaFileImage return an image for a music item.
I think I am making the right call:
Code:
http://10.0.0.11:8080/sagex/thumbnail/205731
Where 205731 is the media ID of currently playing song that has album art.
I get this response:
Code:
<h1>sagex.api (7.0.19.0): Media Handler Error</H1>
<h2>No Image</H2><pre>
java.lang.Exception: No Image
.....
So, unless I misunderstood you, I don't think the default thumbnail handler is working for embedded music cover art.

Quote:
I think that when I add music support, i'll probably need a specialized /music handler to support getting covers and possibly artists.

And I agree, the, /media handlers (all handlers actually) should return a 404 if the images does not exist.

I've added 2 issues for these requests.
Great!
__________________
Host: ESXi 6.5 w/ Intel Core i7 2.8GHZ 8GB Ram
Guest: Ubuntu 16.04 with Sage v9 in Docker
Tuners: 2 HDHR (OTA);
Extenders: HD300 connected to a Samsung 56" DLP HDTV; HD300 connected to a Sharp 42" LCD
Storage: OmniOS w/6 1TB Samsung Spinpoint in a RaidZ2 configuration in a 20 bay SATA hotswap case.
Reply With Quote
  #236  
Old 10-21-2010, 08:25 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by broconne View Post
I think I am making the right call:
Code:
http://10.0.0.11:8080/sagex/thumbnail/205731
Where 205731 is the media ID of currently playing song that has album art.
I get this response:
Code:
<h1>sagex.api (7.0.19.0): Media Handler Error</H1>
<h2>No Image</H2><pre>
java.lang.Exception: No Image
.....
So, unless I misunderstood you, I don't think the default thumbnail handler is working for embedded music cover art.
I didn't know if it would work or not... I thought it might... but it looks like, your testing shows that it doesn't work.

I guess I need a specialized media handler for music.... since you have the sagex-code, and you see how I added the /logo handler... you could add in the music handler, if you wanted
Reply With Quote
  #237  
Old 10-21-2010, 01:09 PM
broconne broconne is offline
Sage Aficionado
 
Join Date: Feb 2009
Location: Cary, NC
Posts: 306
Quote:
Originally Posted by stuckless View Post
I didn't know if it would work or not... I thought it might... but it looks like, your testing shows that it doesn't work.

I guess I need a specialized media handler for music.... since you have the sagex-code, and you see how I added the /logo handler... you could add in the music handler, if you wanted
Sure, I don't mind adding it.. I just didn't want to step on any toes.

Could you PM me your build.properties file so I see what entries you have? I didn't look too hard at the build.xml but it seemed like that was required, wasn't in SVN, and I was hoping to not reverse engineer it.
__________________
Host: ESXi 6.5 w/ Intel Core i7 2.8GHZ 8GB Ram
Guest: Ubuntu 16.04 with Sage v9 in Docker
Tuners: 2 HDHR (OTA);
Extenders: HD300 connected to a Samsung 56" DLP HDTV; HD300 connected to a Sharp 42" LCD
Storage: OmniOS w/6 1TB Samsung Spinpoint in a RaidZ2 configuration in a 20 bay SATA hotswap case.
Reply With Quote
  #238  
Old 10-21-2010, 02:02 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by broconne View Post
Sure, I don't mind adding it.. I just didn't want to step on any toes.

Could you PM me your build.properties file so I see what entries you have? I didn't look too hard at the build.xml but it seemed like that was required, wasn't in SVN, and I was hoping to not reverse engineer it.
I will try to remember to send you an email, tonight, on what should be in the build.properties. The build.properties, if i recall, contain the location of your sage.jar, google code credentials, etc. ie, things that are specific to your environment. I'll dig up mine, share the baseic structure, where to put it, etc.
Reply With Quote
  #239  
Old 11-27-2010, 03:33 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
7.0.23.2

I've just released 7.0.23.2 of the sagex-apis (Remote APIs for Sage TV). While this release is "minor" from the version #, there are number of significant changes.

1. I've removed the remote interfaces for legacy xml, json, xbmc, and java. This means that the http interfaces for /sagex/xmlrpc, /sagex/javarpc, /sagex/jsonrpc and /sagex/xbmcrpc no long exist. The xml and json interfaces were no longer needed, since they have been a part of the /sagex/api servlet. The Xmbc and Java interfaces were removed because i no longer want to supprt them. If you are using RMI or the /sagex/api interfaces for accessing the remote apis, then things will still work the same.

2. Under the RMI interface, I used to cache objects on the server, and that cache would never expire. Basically you'd eventually get an out of memory on the server, if you were constantly using sagex apis over rmi. This was never an issue, since the RMI access was mainly used by myself in development, and there were no external plugins that used the RMI interfaces... until now. Slugger has released (or is releasing) a new version of SJQ that will use the rmi interface for accessing calling the sage apis from remote clients. Because of this a new "reaper" thread has been added that cleans up stale objects after a given amount of time.

These changes probably will not affect anyone, since they relate to adding a new feature, and removing 4 obsolete features.

Bottom line, if you have no idea what I'm talking about here... you are probably not affected by these changes And don't confuse #1 with the complete removal of xml and json... the remote xml and json interfaces still exist, as they have for long time, under the /sagex/api thread.
Reply With Quote
  #240  
Old 12-02-2010, 11:30 AM
bradvido's Avatar
bradvido bradvido is offline
Sage User
 
Join Date: Nov 2010
Location: MN
Posts: 68
I've got a question on how to use the api. I'm trying to get XML over http.

Say, for example, I want to call GetFileDuration, which takes 1 parameter:
Code:
1; MediaFile:sage.MediaFile
What should i use for this MediaFile parameter? Do i just pass in the mediafileID? I tried that like so, where my MediaFileID is 86533:
Code:
http://localhost:8080/sagex/api?c=GetFileDuration&1=86533
but it returned
Code:
<Result>0</Result>
Is the media file ID not the right thing to pass in? How can i pass a MedaiFile object in?

Last edited by bradvido; 12-02-2010 at 11:35 AM.
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
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


All times are GMT -6. The time now is 11:17 AM.


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