Author Topic: XBMC JSON: for pre-Frodo nightlies after Oct. 9th 2012  (Read 25833 times)

0 Members and 4 Guests are viewing this topic.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: XBMC JSON: for pre-Frodo nightlies after Oct. 9th 2012
« Reply #90 on: January 16, 2013, 10:51:15 AM »
Is it possible to setup commands to launch specific XBMC add-ons and smart playlists?

Yes.  The commands for addons will vary but here's an example that opens the subtitle downloader addon while viewing video:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<command id="388" name="download subtitles" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>XJson.Raw</cmdType>
    <cmdString>Addons.ExecuteAddon&amp;&amp;"addonid":"script.xbmc.subtitles"</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>download subtitles</phrase>
</command>

Here is one way to open a smart playlist:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<command id="131" name="open smart playlist" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>XJson.Raw</cmdType>
    <cmdString>GUI.ActivateWindow&amp;&amp;"window": "video", "parameters": [ "special://profile/playlists/mixed/voxsmart.xsp" ]</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
</command>

Kickers56

  • Guest
Re: XBMC JSON: for pre-Frodo nightlies after Oct. 9th 2012
« Reply #91 on: February 01, 2013, 11:26:45 AM »
Hi guys,

Making the switch to Frodo (final release) and VC (0.9.8.0) and see all your hard work remapping everything through Json has really paid off. I'm going to have a play around myself to understand how it all works with some of my own commands, but for sake of speed I wonder if its possible to control pvr channels? If so, if I wanted to switch to channel 5 (whatever station is mapped to channel 5) is there a command to do that through VC.

I searched these forums and couldn't find any mention of this and if no one has done it I will play around with Json myself but if someone has already got a command xml for doing this, great.

oh love all the enhancements to VC, particularly the command editor...well done.

tom

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: XBMC JSON: for pre-Frodo nightlies after Oct. 9th 2012
« Reply #92 on: February 01, 2013, 11:40:18 AM »
Hi Kickers,

Unfortunately I don't have any PVR hardware so it is kind of difficult for me to work on this.  However, if you have time we could work on it together on your system using TeamViewer, and then I could add the commands to the default config.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: XBMC JSON: for pre-Frodo nightlies after Oct. 9th 2012
« Reply #93 on: February 02, 2013, 02:06:17 PM »
you can try this command.  I have no way of testing it, so I don't know if it works

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<command id="800" name="Change to channel {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>XJson.Raw</cmdType>
    <cmdString>Player.Open&amp;&amp;"item":{"channelid":{1}}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Change to channel</phrase>
  <payloadRange>1,200</payloadRange>
</command>

Kickers56

  • Guest
Re: XBMC JSON: for pre-Frodo nightlies after Oct. 9th 2012
« Reply #94 on: February 04, 2013, 12:15:14 PM »
Sorry about late reply, had a 'working' weekend.

Tried the xml you provided above and it does (I don't know how you do it) work. It goes instantly to the channel I specify. It does however, when I say 'channel 1' start up the 1st radio station I have tuned rather than the tv channels. So I have to start at channel numbers from 30 after all my radio stations to get the tv channels, but that obviously is how the backend has set up my channel listings. I will either have a play around with the backend to see if I can swap them, or just set up commands once I know all the channel ID's for the TV channels with phrases to the station names. Time consuming - but what I wanted anyway.

So in conclusion, what you did works with the PVR setup in Frodo(final release).

Thanks James

kickers56

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: XBMC JSON: for pre-Frodo nightlies after Oct. 9th 2012
« Reply #95 on: February 04, 2013, 04:37:58 PM »
Glad to hear it.  :D ;D

Once you get everything set up correctly, could you please send me the epg.db file that is in your XBMC database folder?

C:\Users\YOURUSERNAMEHERE\AppData\Roaming\XBMC\userdata\Database

and the filename is something like "Epg7.db"

I'll see if there is a way to generate the channel names payloadXML from that.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: XBMC JSON: for pre-Frodo nightlies after Oct. 9th 2012
« Reply #96 on: February 04, 2013, 04:39:55 PM »
oh and I guess all the file: "TV22.db"

Kickers56

  • Guest
Re: XBMC JSON: for pre-Frodo nightlies after Oct. 9th 2012
« Reply #97 on: February 08, 2013, 04:10:02 PM »
Ok, here is the tv22 db file you requested

It works great after I manually put in the channel names. Just for reference I am using tvheadend backend tv server and XBMC frodo seems to read the radio channels first then tv channels after. There doesnt seem to be a way I can change this in tvheadend. But you can change channel order within xbmc rather than getting the order from tvheadend server.

Hope it helps

[attachment=1]

Kickers56

  • Guest
Re: XBMC JSON: for pre-Frodo nightlies after Oct. 9th 2012
« Reply #98 on: February 08, 2013, 04:14:46 PM »
I seem to be getting timeouts when trying to upload the epg7 db file...trying again, this time in rar file

Kickers56

  • Guest
Re: XBMC JSON: for pre-Frodo nightlies after Oct. 9th 2012
« Reply #99 on: February 08, 2013, 04:15:35 PM »
that did it!

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: XBMC JSON: for pre-Frodo nightlies after Oct. 9th 2012
« Reply #100 on: February 08, 2013, 05:01:50 PM »
Great.  Thanks.  I don't really understand the whole TV/Radio situation.  It sounds like you can't have both a channel 5 radio and channel 5 TV.  Is that right?  Weird, but there must be some way around it?

Anyway please try the attached update to the XSql plugin which should help to auto-generate the payloadxml for radio and tv channels.

I suggest you delete your options.xml from the XSql plugins folder, but if you don't want to do that, then edit your options.xml in the plugin folder it and add the following entries to the <genXML> sectino so it looks like this:

Code: [Select]
    <genXml>
        <genXmlParam dataType="Music" queryString="select idArtist,strArtist from artist" xmlFilename="xbmcArtists" useSubStrings="True" />
        <genXmlParam dataType="Music" queryString="select idAlbum,strAlbum from album" xmlFilename="xbmcAlbums" useSubStrings="True" />
        <genXmlParam dataType="Music" queryString="select idSong,strTitle from song" xmlFilename="xbmcSongs" useSubStrings="True" />
        <genXmlParam dataType="Music" queryString="select idGenre,strGenre from genre" xmlFilename="xbmcGenres" useSubStrings="False" />
        <genXmlParam dataType="Music" queryString="select distinct idSong,strTitle,strArtists from songview where strArtists!=&quot;&quot;" xmlFilename="XbmcSongsByArtist" useSubStrings="False" />
        <genXmlParam dataType="Video" queryString="select idShow,c00 from tvshow" xmlFilename="xbmcTvShowTitles" useSubStrings="True" />
        <genXmlParam dataType="Video" queryString="select idMovie,c00 from movie" xmlFilename="xbmcMovieIDs" useSubStrings="True" />
        <genXmlParam dataType="Video" queryString="select strpath||strfilename,c00 from movieview" xmlFilename="xbmcMovies" useSubStrings="True" />
        <genXmlParam dataType="TV" queryString="select idChannel, sChannelName from channels where bIsRadio=1" xmlFilename="xbmcRadioChannels" useSubStrings="true" />
        <genXmlParam dataType="TV" queryString="select idChannel, sChannelName from channels where bIsRadio=0" xmlFilename="xbmcTvChannels" useSubStrings="true" />
    </genXml>

the new lines are:

Code: [Select]
        <genXmlParam dataType="TV" queryString="select idChannel, sChannelName from channels where bIsRadio=1" xmlFilename="xbmcRadioChannels" useSubStrings="true" />
        <genXmlParam dataType="TV" queryString="select idChannel, sChannelName from channels where bIsRadio=0" xmlFilename="xbmcTvChannels" useSubStrings="true" />

I hope it's clear but if you need help let me know.  Note that you can customize this depending on your needs.  For example if you just want one command for TV and Radio you could create a single query, instead of the two separate ones

example:
Code: [Select]
<genXmlParam dataType="TV" queryString="select idChannel, sChannelName from channels" xmlFilename="xbmcAllChannels" useSubStrings="true" />

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: XBMC JSON: for pre-Frodo nightlies after Oct. 9th 2012
« Reply #101 on: February 08, 2013, 05:06:14 PM »
Also you need to check your plugin settings to confirm that the path for the TV database is pointing to the correct file: "TV22.db"

OH, and if you don't want to mess around with the xml files you can go into the plugin settings and add two new entries in the table.

Set the type for both of them to "TV", assign whatever filenames you want for the xmlpayload files and for the Query enter these:

for Radio Channels:
Code: [Select]
select idChannel, sChannelName from channels where bIsRadio=1
for TV Channels:
Code: [Select]
select idChannel, sChannelName from channels where bIsRadio=0

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: XBMC JSON: for pre-Frodo nightlies after Oct. 9th 2012
« Reply #102 on: February 21, 2013, 03:19:55 PM »
After I get the time to count, I call a vbscript that returns the time to count in seconds, so I can use [attachment=1][attachment=1]the VC.SetEventTimer (is there any way to calculate simple arithmatics with VC itself?).
Yes.  There is now, with the python plugin  :D

http://voxcommando.com/forum/index.php?topic=1005.msg8409#msg8409