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
  #381  
Old 01-12-2012, 06:44 AM
routerunner's Avatar
routerunner routerunner is offline
Sage Icon
 
Join Date: May 2008
Location: Wiltshire, UK
Posts: 1,384
Help on "IsEmbeddedSystem"

Hi,

I'm working on a server only plugin and I need to know whether the connected clients is one of the supported media extenders. I thought to use the IsEmbeddedSystem call (see the sageEvent code snippet below) however it always return "false".

Any help is appreciated and BTW sagex rocks!

HTML Code:
if (CLIENT_CONNECTED.equals(eventName))
{
    String MAC = (String)eventVars.get("MACAddress");			
    // It MUST be an extender
    if (MAC != null) 
    {
        UIContext context = new UIContext(MAC);
        // It must be an HD Media Extender (HD-x00)
        if (Global.IsEmbeddedSystem(context))
        {
            clients.put(MAC, new Extender((String)eventVars.get("IPAddress"), context));
        }
    }
} 
__________________

Automatic Power Off | Squeezeslave | DVB-S Importer | DVB Decrypter & Card Client | Tuner Preroll


Every man is a damn fool for at least five minutes every day; wisdom consists in not exceeding the limit. ~ Elbert Hubbard
Reply With Quote
  #382  
Old 01-12-2012, 07:41 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by routerunner View Post
Hi,

I'm working on a server only plugin and I need to know whether the connected clients is one of the supported media extenders. I thought to use the IsEmbeddedSystem call (see the sageEvent code snippet below) however it always return "false".

Any help is appreciated and BTW sagex rocks!

HTML Code:
if (CLIENT_CONNECTED.equals(eventName))
{
    String MAC = (String)eventVars.get("MACAddress");			
    // It MUST be an extender
    if (MAC != null) 
    {
        UIContext context = new UIContext(MAC);
        // It must be an HD Media Extender (HD-x00)
        if (Global.IsEmbeddedSystem(context))
        {
            clients.put(MAC, new Extender((String)eventVars.get("IPAddress"), context));
        }
    }
} 
If you have the phoenix api installed, you can call... phoenix.util.IsExtender(ctx)... or at the very least, you can look at the code for it..

http://code.google.com/p/sagephoenix...l/UtilAPI.java
Reply With Quote
  #383  
Old 01-12-2012, 08:23 AM
routerunner's Avatar
routerunner routerunner is offline
Sage Icon
 
Join Date: May 2008
Location: Wiltshire, UK
Posts: 1,384
Quote:
Originally Posted by stuckless View Post
If you have the phoenix api installed, you can call... phoenix.util.IsExtender(ctx)... or at the very least, you can look at the code for it..

http://code.google.com/p/sagephoenix...l/UtilAPI.java
Thanks for the information, I've replaced my snippet with the same piece of code that "IsExtender" API does:

[if (Global.IsRemoteUI(context) && !Global.IsDesktopUI(context)]

but unfortunately the test is still returning true when a PlaceShifter client is connected.

I think that "IsDesktopUI" is only working properly when called within the extender context, but cannot be used in a plugin running in the server context, however the "GetTimeSinceLastInput" works properly in the server context by passing the context object of the extender you want to get the information from.
__________________

Automatic Power Off | Squeezeslave | DVB-S Importer | DVB Decrypter & Card Client | Tuner Preroll


Every man is a damn fool for at least five minutes every day; wisdom consists in not exceeding the limit. ~ Elbert Hubbard
Reply With Quote
  #384  
Old 01-12-2012, 08:47 AM
Fonceur's Avatar
Fonceur Fonceur is offline
Sage Icon
 
Join Date: Jan 2008
Location: DDO, QC
Posts: 1,915
Quote:
Originally Posted by routerunner View Post
I'm working on a server only plugin and I need to know whether the connected clients is one of the supported media extenders.
This is based on GKusnick Studio Tools, but similar ideas apply:

Code:
    public boolean isExtender(API sageApi) {
        return (sageApi.global.IsRemoteUI() && !sageApi.global.IsDesktopUI());
    }

    public boolean isPlaceshifter(API sageApi) {
        return (sageApi.global.IsRemoteUI() && sageApi.global.IsDesktopUI());
    }

    public boolean isMvp(API sageApi){
        return isExtender(sageApi) && sageApi.configuration.GetAudioOutputOptions() == null;
    }

    public boolean isHDExtender(API sageApi){
        return isExtender(sageApi) && sageApi.configuration.GetAudioOutputOptions() != null;
    }
I've stripped the try/catch, and you could further differentiate the HD100/200/300 based on audio... So indeed that is what you are already testing...

Quote:
I think that "IsDesktopUI" is only working properly when called within the extender context
Of course, if you use the server's context then you are testing the server, not the client...
__________________
SageTCPServer (2.3.5): Open source TCP interface to the SageTV API
MLSageTV (3.1.8)/Sage Media Server (1.13): SageTV plugin for MainLobby/CQC
TaSageTV (2.58)/TaSTVRemote (1.14): Monitor/control SageTV with an Android device
TbSageTV (1.02)/STVRemote (1.11): Monitor/control SageTV with a PlayBook 2
TiSageTV (1.64)/TiSTVRemote (1.09): Monitor/control SageTV with an iPhone/iPod/iPad
Reply With Quote
  #385  
Old 01-12-2012, 09:21 AM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
Check out the API docs for GetRemoteUIType() & try that call.

- Andy
__________________
SageTV Open Source v9 is available.
- Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1.
- Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus
- HD Extenders: A) FAQs B) URC MX-700 remote setup
Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request.
Reply With Quote
  #386  
Old 01-12-2012, 09:33 AM
routerunner's Avatar
routerunner routerunner is offline
Sage Icon
 
Join Date: May 2008
Location: Wiltshire, UK
Posts: 1,384
Thank you very much for the useful information, but still no luck

I think the problem is how you generate the "UIContext" in the first place. My understanding from a server plugin perspective is:

- CLIENT_CONNECTED event gives you the UIContext as String and being the MAC address of the connected client, or null if is a Software Client, unfortunately a PlaceShifter will have the MAC address of the machine is running on, so no good for my purposes
- PLAYBACK_STARTED event gives you back the same UIContext as String and again being the MAC address of the client, brilliant!
- All the sage.api that supports an UIContext parameter expect a String and for extenders that string is the MAC address, unfortunately is a pain to access that APIs from java, then the fantastic "sagex.api" allows you to do the same thing, but they require a new object type for the UIContext, not a string any more, so my question is:

sage.api UIContext == sagex.api new UIContext(sage.api UIContext) ?

Because it does look like, but not in all occasions...

Quote:
Of course, if you use the server's context then you are testing the server, not the client...
Sorry, I meant calling IsDesktopUI(context) form where "context" is the Extender's context you want to get information from, not the server context.
__________________

Automatic Power Off | Squeezeslave | DVB-S Importer | DVB Decrypter & Card Client | Tuner Preroll


Every man is a damn fool for at least five minutes every day; wisdom consists in not exceeding the limit. ~ Elbert Hubbard
Reply With Quote
  #387  
Old 01-12-2012, 09:56 AM
routerunner's Avatar
routerunner routerunner is offline
Sage Icon
 
Join Date: May 2008
Location: Wiltshire, UK
Posts: 1,384
Quote:
Originally Posted by Opus4 View Post
Check out the API docs for GetRemoteUIType() & try that call.

- Andy
I tried that call already and for an HD200 & HD300 it does return null, however for a Placeshifter it does effectively return the string "Placeshifter".

The above is happening assuming the following code running in a server plugin inside the sageEvent method:

Code:
if (CLIENT_CONNECTED.equals(eventName))
{
    String MAC = (String)eventVars.get("MACAddress");			
    // It MUST be an extender
    if (MAC != null)
    {
        UIContext context = new UIContext(MAC);
        System.out.println(Global.GetRemoteUIType(context));
    }
}
Thanks
Eddy
__________________

Automatic Power Off | Squeezeslave | DVB-S Importer | DVB Decrypter & Card Client | Tuner Preroll


Every man is a damn fool for at least five minutes every day; wisdom consists in not exceeding the limit. ~ Elbert Hubbard
Reply With Quote
  #388  
Old 01-12-2012, 04:13 PM
routerunner's Avatar
routerunner routerunner is offline
Sage Icon
 
Join Date: May 2008
Location: Wiltshire, UK
Posts: 1,384
UIContext this friend...

I had further thoughts about my issues on using the "UIContext" and I think I've got a definitive answer and everybody is welcome to dismantle my theory

The main reason why the "UIContext" family of command exists is because you want to be able to get, set and control different clients connected to the same server, but from the server point of view and not from the client point of view because every client is running within its context already. But the question is, who determine when the context is ready to be used? I reckon that a client has its context defined and ready to be used only when the STV, for that client, is completely loaded and running, only at that point the context is valid and can be safely used.

In a server plugin you can register for different events, the "ClientConnected" is the one used to get the IP/MAC address of the connecting client, not the connected, in fact if you query any of the API that requires the UIContext just after receiving this event, the STV hasn't finished to load yet, hence you will receive false positives, but just after the STV is loaded and up and running, then the UIContext commands family works as expected and I can prove it.

People that develops STVs or STVi doesn't have this problem, because they can use the UIContext family of commands only when the UI is up and running.

Solution?

There are many solution to this issue and I'll deal with it, however the one I like most is to introduce an extra user registered event called "STVUpAndRunning" which will tell you when the STV is up and running and ready to be controlled by a server plugin with the UIContext family APIs.

Alternatively there is another existing event called "SystemMessagePosted" with one argument "SystemMessage". Does anyone knows the list of possible messages or whether there is a system message already that tells you when an STV is up and running?

Any thoughts?

Thanks
Eddy
__________________

Automatic Power Off | Squeezeslave | DVB-S Importer | DVB Decrypter & Card Client | Tuner Preroll


Every man is a damn fool for at least five minutes every day; wisdom consists in not exceeding the limit. ~ Elbert Hubbard
Reply With Quote
  #389  
Old 01-12-2012, 04:43 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by routerunner View Post
I had further thoughts about my issues on using the "UIContext" and I think I've got a definitive answer and everybody is welcome to dismantle my theory

The main reason why the "UIContext" family of command exists is because you want to be able to get, set and control different clients connected to the same server, but from the server point of view and not from the client point of view because every client is running within its context already. But the question is, who determine when the context is ready to be used? I reckon that a client has its context defined and ready to be used only when the STV, for that client, is completely loaded and running, only at that point the context is valid and can be safely used.

In a server plugin you can register for different events, the "ClientConnected" is the one used to get the IP/MAC address of the connecting client, not the connected, in fact if you query any of the API that requires the UIContext just after receiving this event, the STV hasn't finished to load yet, hence you will receive false positives, but just after the STV is loaded and up and running, then the UIContext commands family works as expected and I can prove it.

People that develops STVs or STVi doesn't have this problem, because they can use the UIContext family of commands only when the UI is up and running.

Solution?

There are many solution to this issue and I'll deal with it, however the one I like most is to introduce an extra user registered event called "STVUpAndRunning" which will tell you when the STV is up and running and ready to be controlled by a server plugin with the UIContext family APIs.

Alternatively there is another existing event called "SystemMessagePosted" with one argument "SystemMessage". Does anyone knows the list of possible messages or whether there is a system message already that tells you when an STV is up and running?

Any thoughts?

Thanks
Eddy
Depending on how time sensitive your server code is... couldn't you just do something like...

Code:
final UIConext ctx = new UIContext(client);
Timer t = new Timer();
TimerTask task = new TimerTask() {
    public void run() {
         // do you checks using the ctx variable
    }
};
t.schedule(task, 60*1000);
That would run the code the code 60 seconds after the client connected. You could probably shorten the time.
Reply With Quote
  #390  
Old 01-12-2012, 04:57 PM
routerunner's Avatar
routerunner routerunner is offline
Sage Icon
 
Join Date: May 2008
Location: Wiltshire, UK
Posts: 1,384
Quote:
Originally Posted by stuckless View Post
Depending on how time sensitive your server code is... couldn't you just do something like...

Code:
final UIConext ctx = new UIContext(client);
Timer t = new Timer();
TimerTask task = new TimerTask() {
    public void run() {
         // do you checks using the ctx variable
    }
};
t.schedule(task, 60*1000);
That would run the code the code 60 seconds after the client connected. You could probably shorten the time.
Of course, as I said before, when you finally know what the problem is you can think at many ways to fix it; I was just suggesting a more clean, deterministic and future proof solution really

Eddy
__________________

Automatic Power Off | Squeezeslave | DVB-S Importer | DVB Decrypter & Card Client | Tuner Preroll


Every man is a damn fool for at least five minutes every day; wisdom consists in not exceeding the limit. ~ Elbert Hubbard
Reply With Quote
  #391  
Old 01-12-2012, 06:04 PM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
You might be able to be a bit more crude on it, and just check the MAC prefix for Sage's OUI. All SageTV produced hardware will have a MAC address starting with 0023A5
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
  #392  
Old 01-12-2012, 06:21 PM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
Quote:
Originally Posted by routerunner View Post
Of course, as I said before, when you finally know what the problem is you can think at many ways to fix it; I was just suggesting a more clean, deterministic and future proof solution really

Eddy
The whole UIContext thing is a PITA and any improvements would be welcome. Unfortunately I don't think we'll get any updates in this area given the Google acquisition.
__________________

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
  #393  
Old 01-12-2012, 06:28 PM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
Quote:
Originally Posted by tmiranda View Post
The whole UIContext thing is a PITA and any improvements would be welcome. Unfortunately I don't think we'll get any updates in this area given the Google acquisition.
I actually think the UI Context thing could be expanded upon... I think we've determined at this point that the separation of the UI Contexts and the Server process is required going forward. Many are already hitting the limits of the single Java Heap. I'm hoping any future versions of sagoogletv implement the extender UI Contexts in their own processes (with the capability to pull shared resources from the server process). This may actually simplify the core code base, as much of the client code could be shared with the extender host code.

Getting way off topic now though...
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
  #394  
Old 10-04-2012, 09:08 PM
HokiePerogi HokiePerogi is offline
Sage Advanced User
 
Join Date: Oct 2008
Posts: 187
Bad XML in GetMediaFiles Response?

I've been running the following command for weeks on a nightly basis to build an external file for myself. However, it seems to have started to fail sometime between tonight and a few weeks ago. I am unable to get the full result set from the following sagex request:

Code:
http://sagepc:8009/sagex/api?c=GetMediaFiles&1=VDBL&start=0&size=50

Google Chrome responds with:
Code:
This page contains the following errors:

error on line 180 at column 16: Specification mandate value for attribute Voice
Below is a rendering of the page up to the first error.
Full XML attached as 2.txt


And IE 8 responds with:
Code:
- <Result size="50">
- <MediaFile>
- <MediaFileFormatDescription>
- <![CDATA[ MPEG2-TS[H.264 16:9 720p@60fps, Dolby Digital/384Kbps@48kHz Stereo]
  ]]> 
  </MediaFileFormatDescription>
  <IsLibraryFile>true</IsLibraryFile> 
  <IsCompleteRecording>true</IsCompleteRecording> 
  <IsPictureFile>false</IsPictureFile> 
- <SegmentFiles size="1">
- <File>
- <![CDATA[ E:\StrangerThanFiction-1844288-0.ts
  ]]> 
  </File>
  </SegmentFiles>
- <MediaTitle>
- <![CDATA[ Stranger Than Fiction
  ]]> 
  </MediaTitle>
- <ParentDirectory>
- <![CDATA[ E:\
  ]]> 
  </ParentDirectory>
  <IsThumbnailLoaded>false</IsThumbnailLoaded> 
  <FileDuration>8981301</FileDuration> 
  <FileStartTime>1300406422464</FileStartTime> 
  <FileEndTime>1300415403765</FileEndTime> 
  <NumberOfSegments>1</NumberOfSegments> 
  <IsMediaFileObject>true</IsMediaFileObject> 
  <AlbumForFile /> 
- <MediaFileEncoding>
- <![CDATA[ 
  ]]> 
  </MediaFileEncoding>
- <Airing>
- <RecordingName>
- <![CDATA[ 
  ]]> 
  </RecordingName>
- <AiringChannelName>
- <![CDATA[ 
  ]]> 
  </AiringChannelName>
  <AiringDuration>9000000</AiringDuration> 
  <AiringStartTime>1300406400000</AiringStartTime> 
  <AiringEndTime>1300415400000</AiringEndTime> 
- <AiringRatings size="5">
- <Item>
- <![CDATA[ TVPG
  ]]> 
  </Item>
- <Item>
- <![CDATA[ PG-13
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Nudity
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Language
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Adult Situations
  ]]> 
  </Item>
  </AiringRatings>
  <ScheduleStartTime>1300406400000</ScheduleStartTime> 
  <ScheduleEndTime>1300415400000</ScheduleEndTime> 
  <ScheduleDuration>9000000</ScheduleDuration> 
- <AiringTitle>
- <![CDATA[ Stranger Than Fiction
  ]]> 
  </AiringTitle>
  <WatchedDuration>0</WatchedDuration> 
  <WatchedStartTime>0</WatchedStartTime> 
  <WatchedEndTime>0</WatchedEndTime> 
  <LatestWatchedTime>1300406400000</LatestWatchedTime> 
  <IsWatchedCompletely>false</IsWatchedCompletely> 
  <IsManualRecord>false</IsManualRecord> 
  <TrackNumber>0</TrackNumber> 
- <RecordingQuality>
- <![CDATA[ 
  ]]> 
  </RecordingQuality>
  <IsAiringObject>true</IsAiringObject> 
- <ParentalRating>
- <![CDATA[ TVPG
  ]]> 
  </ParentalRating>
  <AiringPartNumber>1</AiringPartNumber> 
  <AiringTotalParts>1</AiringTotalParts> 
- <ScheduleRecordingRecurrence>
- <![CDATA[ 
  ]]> 
  </ScheduleRecordingRecurrence>
- <Channel>
- <ChannelName>
- <![CDATA[ 
  ]]> 
  </ChannelName>
  <ChannelNetwork /> 
- <ChannelNumber>
- <![CDATA[ 
  ]]> 
  </ChannelNumber>
  <IsChannelViewable>false</IsChannelViewable> 
  <IsChannelObject>true</IsChannelObject> 
  <ChannelLogoCount>0</ChannelLogoCount> 
  <StationID>0</StationID> 
- <ChannelDescription>
- <![CDATA[ 
  ]]> 
  </ChannelDescription>
  </Channel>
- <Show>
- <ShowCategory>
- <![CDATA[ Movie
  ]]> 
  </ShowCategory>
  <IsShowEPGDataUnique>true</IsShowEPGDataUnique> 
- <ShowSubCategory>
- <![CDATA[ Comedy
  ]]> 
  </ShowSubCategory>
- <ShowDescription>
- <![CDATA[ A mentally unstable IRS auditor (Will Ferrell) hears an author's (Emma Thompson) voice in his head and discovers that he is the ill-fated protagonist of her latest work. While a book-company employee (Queen Latifah) tries to cure the author's case of writer's block, the auditor and a professor (Dustin Hoffman) set out to find the woman and make her change her story.
  ]]> 
  </ShowDescription>
- <ShowEpisode>
- <![CDATA[ 
  ]]> 
  </ShowEpisode>
  <ShowDuration>6300000</ShowDuration> 
- <ShowExternalID>
- <![CDATA[ MV1775540000
  ]]> 
  </ShowExternalID>
- <PeopleInShow>
- <![CDATA[ Will Ferrell, Maggie Gyllenhaal, Dustin Hoffman, Queen Latifah, Emma Thompson, Tony Hale, Tom Hulce, Linda Hunt, Eli Goodman, Denise Hughes, Jason Burke, Linara Washington, Marc Forster, Zach Helm, Lindsay Doran, Joseph Drake, Nathan Kahane, Eric Kopeloff
  ]]> 
  </PeopleInShow>
- <PeopleListInShow size="18">
- <Item>
- <![CDATA[ Will Ferrell
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Maggie Gyllenhaal
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Dustin Hoffman
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Queen Latifah
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Emma Thompson
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Tony Hale
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Tom Hulce
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Linda Hunt
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Eli Goodman
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Denise Hughes
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Jason Burke
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Linara Washington
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Marc Forster
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Zach Helm
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Lindsay Doran
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Joseph Drake
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Nathan Kahane
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Eric Kopeloff
  ]]> 
  </Item>
  </PeopleListInShow>
- <RolesInShow size="18">
- <Item>
- <![CDATA[ Actor
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Actor
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Actor
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Actor
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Actor
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Actor
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Actor
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Actor
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Actor
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Actor
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Actor
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Actor
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Director
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Writer
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Producer
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Executive Producer
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Executive Producer
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Executive Producer
  ]]> 
  </Item>
  </RolesInShow>
- <ShowLanguage>
- <![CDATA[ English
  ]]> 
  </ShowLanguage>
  <ShowSeasonNumber>0</ShowSeasonNumber> 
  <ShowEpisodeNumber>0</ShowEpisodeNumber> 
- <PeopleAndCharacterListInShow size="18">
- <Item>
- <![CDATA[ Will Ferrell
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Maggie Gyllenhaal
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Dustin Hoffman
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Queen Latifah
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Emma Thompson
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Tony Hale
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Tom Hulce
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Linda Hunt
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Eli Goodman
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Denise Hughes
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Jason Burke
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Linara Washington
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Marc Forster
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Zach Helm
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Lindsay Doran
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Joseph Drake
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Nathan Kahane
  ]]> 
  </Item>
- <Item>
- <![CDATA[ Eric Kopeloff
  ]]> 
  </Item>
  </PeopleAndCharacterListInShow>
- <ShowCategoriesString>
- <![CDATA[ Movie / Comedy / Fantasy
  ]]> 
  </<The XML page cannot be displayed 
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later. 


--------------------------------------------------------------------------------

A name contained an invalid character. Error processing resource 'http://sagepc:8009/sagex/api?c=GetMediaFiles&1=VDBL&start...
 
    <Guest Voice><![CDATA[]]></Guest Voice>
----------------^
/SPAN>ShowCategoriesString>
- <ShowCategoriesList size="3">
<DIV

When I run my vbscript code to get the results of this query and then parse the dom (as a MSXML2.DOMDocument), the parsing is failing to find the elements:

ShowEpisode
MediaFileID
MediaTitle

I'm thinking because there is something wrong with returned XML, or some recent windows update changed the behavior somehow.

Any thoughts or ideas what could be wrong?


Thanks!
Attached Files
File Type: txt 2.txt (639.3 KB, 334 views)
__________________
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
Reply With Quote
  #395  
Old 10-05-2012, 09:58 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
@HokiePerogi - 7.1.9.11 should fix your issue.

One a side note, I noticed something in the Sagex rest apis, that I didn't realize that I had implemented, which is filtering of fields in a request. Originally this filtering code existed in the JSON serializer but not in the xml serializer, so now it's there in both.

The /sagex/api help page has been updated to reflect the 'filter' parameter.

I think several people have asked if they could filter the fields being returns, and I've always replied 'no'...

A use case for this, is that when you call, GetMediaFiles, you might only want to, initially, send back the MediaFileID, and Title, and not all off the 100s of other fields. So, to do that, simply append,
Code:
filter=MediaFileID|MediaTitle
to the query and ONLY fields matching those names will be returned.
Reply With Quote
  #396  
Old 10-05-2012, 10:53 AM
HokiePerogi HokiePerogi is offline
Sage Advanced User
 
Join Date: Oct 2008
Posts: 187
Quote:
Originally Posted by stuckless View Post
@HokiePerogi - 7.1.9.11 should fix your issue.

One a side note, I noticed something in the Sagex rest apis, that I didn't realize that I had implemented, which is filtering of fields in a request. Originally this filtering code existed in the JSON serializer but not in the xml serializer, so now it's there in both.

The /sagex/api help page has been updated to reflect the 'filter' parameter.

I think several people have asked if they could filter the fields being returns, and I've always replied 'no'...

A use case for this, is that when you call, GetMediaFiles, you might only want to, initially, send back the MediaFileID, and Title, and not all off the 100s of other fields. So, to do that, simply append,
Code:
filter=MediaFileID|MediaTitle
to the query and ONLY fields matching those names will be returned.
Awesome. Thanks for the quick turnaround on this fix! I can confirm that my issue is resolved.

I also tried out the new filter parameter which looks very promising, especially for my needs. Using your example worked perfectly. However, for some reason, when I add ShowEpisode to the filter list, or just use ShowEpisode by itself in the filter list, I do not get my expected results:

Code:
http://sagepc:8009/sagex/api?c=GetMediaFiles&1=TVDBL&start=0&size=10&filter=ShowEpisode

results in:

<Result size="10">
<MediaFile/>
<MediaFile/>
<MediaFile/>
<MediaFile/>
<MediaFile/>
<MediaFile/>
<MediaFile/>
<MediaFile/>
<MediaFile/>
<MediaFile/>
</Result>
Is the filter functionality available on all metadata, or only select fields?

Thanks again @stuckless for the continued work on everything SageTV.
__________________
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
Reply With Quote
  #397  
Old 10-05-2012, 11: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 HokiePerogi View Post
Awesome. Thanks for the quick turnaround on this fix! I can confirm that my issue is resolved.

I also tried out the new filter parameter which looks very promising, especially for my needs. Using your example worked perfectly. However, for some reason, when I add ShowEpisode to the filter list, or just use ShowEpisode by itself in the filter list, I do not get my expected results:

Code:
http://sagepc:8009/sagex/api?c=GetMediaFiles&1=TVDBL&start=0&size=10&filter=ShowEpisode

results in:

<Result size="10">
<MediaFile/>
<MediaFile/>
<MediaFile/>
<MediaFile/>
<MediaFile/>
<MediaFile/>
<MediaFile/>
<MediaFile/>
<MediaFile/>
<MediaFile/>
</Result>
Is the filter functionality available on all metadata, or only select fields?

Thanks again @stuckless for the continued work on everything SageTV.
Well, that certainly looks like another bug I just enabled this functionality that existed on the JSON side for the Xml as well. I thought it "worked" but I never did extensive testing. I'll digg into the code and see why it's not working.
Reply With Quote
  #398  
Old 10-05-2012, 11:51 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Ok, It's not quite a bug... but rather a symptom of how the output is created.

In the Xml the ShowEpisode is located several levels deep...

Airing Node -> Show Node -> Show Episode

So, to get the Show Episode, you'd need to ALSO include its parents in the filter as well...

Code:
&filter=MediaFileID|Airing|Show|ShowEpisode
Now, trying that, you'll see that the ShowEpisode still doesn't show. You have to use...

Code:
&filter=MediaFileID|MediaFileAiring|Show|ShowEpisode
ie, even though the Xml node is called "Airing", you need to pass the MediaFile API Name in the filter, which is called, "MediaFileAiring". You can argue that is bug, but I can't change it at this point, since there is too much code out there, that may rely on it being called, "Airing" and not "MediaFileAiring" in the xml

So, in a nutshell, the second example that I posted should work, and when you include a field and you don't see it show up in the reply, try these things...

1. Did you spell it correctly, (case matters)
2. Did you include all the Parent Node APIs as well, (ie, MediaFileAiring, Show, etc)
3. Check if the Xml node is different than the actual Api Name (ie, MediaFileAiring vs just Airing)
Reply With Quote
  #399  
Old 10-05-2012, 02:02 PM
HokiePerogi HokiePerogi is offline
Sage Advanced User
 
Join Date: Oct 2008
Posts: 187
Sweet! That's the ticket! I had a feeling it had something to do with the nesting.

This works great now! Perhaps I can change my approach to run my script on demand instead of nightly now that I can optimize the results coming back from the query.


Thanks again @stuckless!
__________________
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
Reply With Quote
  #400  
Old 11-26-2012, 07:25 AM
routerunner's Avatar
routerunner routerunner is offline
Sage Icon
 
Join Date: May 2008
Location: Wiltshire, UK
Posts: 1,384
GetWindowsRegistryNames?

Hi,

I've been trying to use the Utility.GetWindowsRegistryNames (both local & remote calls) recently without success. For instance:

Code:
String list[] = Utility.GetWindowsRegistryNames("HKEY_LOCAL_MACHINE", "SYSTEM");
Tried with different HIVE/KEY combination, but always gets an empty list of string.

What am I doing wrong? Please advice...

Thanks
Eddy
__________________

Automatic Power Off | Squeezeslave | DVB-S Importer | DVB Decrypter & Card Client | Tuner Preroll


Every man is a damn fool for at least five minutes every day; wisdom consists in not exceeding the limit. ~ Elbert Hubbard

Last edited by routerunner; 11-26-2012 at 07:34 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.