Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Mace

Pages: [1] 2 3 ... 6
1
Bug Reports / Re: plugin error: System.Exception -> xJson
« on: March 26, 2015, 02:01:25 PM »
Judging from web packets I've been watching, it's got to be Kodi.

I can send commands that work and watch all the data. A minute later send the same command and it fails, but all the packets are the same. Just lacks a return packet form Kodi.

It's weird i can run a command that will send 2 json requests, the first will fail and the second will send. Even the kodi log shows the second part working with {Match. 1.1} sent, obviously because the first part of the command failed there was no 'match' so it sent '{Match. 1.1}' instead.
And then a minute later it will work the other way around.
But doesn't mater what commands are sent, it's all totally random.

It feels like the web server just decides to stop talking for a few seconds.
Was just interested to know if anyone else had the same issues.

Oh well the hunts goes on.....

2
Bug Reports / Re: plugin error: System.Exception -> xJson
« on: March 26, 2015, 11:44:30 AM »
The second option.

All sorts of commands, builtin, raw, key strokes. Anything going to the web server.

I'm petty sure its a kodi issue, but seems weird that everything else works (other remote controls) and only have issues with VC.
But only with the windows version.

Beats me.

3
Bug Reports / plugin error: System.Exception -> xJson
« on: March 26, 2015, 07:44:12 AM »
So I've been having a couple errors lately and the log doesn't really help me.

Version: 2.1.4.2
Running VC on Win 7 (service pack 1, .NET: 4.5) on a separate server to Kodi

command example:
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.4.2-->
<command id="856" name="Folder Path" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>XJson.Raw</cmdType>
    <params>
      <param>XBMC.GetInfoLabels</param>
      <param>"labels" : ["Container.FolderPath"]</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
</command>

That's just an example, but it's randomly on everything.
error is: 
Code: [Select]
26/03/2015 8:29:09 PM 952 [plugin] Sending json request:
26/03/2015 8:29:09 PM 952 [plugin] {"jsonrpc": "2.0", "method": "XBMC.GetInfoLabels", "params":{"labels" : ["Container.FolderPath"]},"id": "0"}
26/03/2015 8:29:10 PM 305 [plugin] Web Exception while calling JSON RPC:{"jsonrpc": "2.0", "method": "XBMC.GetInfoLabels", "params":{"labels" : ["Container.FolderPath"]},"id": "0"}
System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
   at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   --- End of inner exception stack trace ---
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   at System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.GetResponse()
   at vcPlugin.xJsonHttpCommunicator.PostRequest(String strRequest)
26/03/2015 8:29:10 PM 305 [error] plugin error:
System.Exception: Failed to connect to XBMC:
System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
   at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   --- End of inner exception stack trace ---
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   at System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.GetResponse()
   at vcPlugin.xJsonHttpCommunicator.PostRequest(String strRequest)
   at vcPlugin.xJsonHttpCommunicator.PostRequest(String strRequest)
   at vcPlugin.xJsonHttpCommunicator.getObj(String[] allParameters)
   at vcPlugin.xJsonHttpCommunicator.jsonRaw(String[] allParameters, Boolean convertSlashToFwd)
   at vcPlugin.Plugin.doAction(String[] parsedActions, String[] parsedParams)
   at eval_d.eval_ᜃ(macroElement A_0, List`1 A_1, Int32 A_2)

I know this looks like a host thing more so than VC.
If I do a reconnect to webserver it works for a few seconds then decides to drop connection again.
It only ever seems to appear when trying to talk to Kodi on another windows 7 system.
I have a appletv and openelec kodi aswell and this error doesn't appear.
I can run a REST client from chrome on the same system as my server and have no issues, but i think that might connect differently.
I can log onto remote server on the same system as my server without a problem.
And my app on my iPad doesn't have any issues connecting.
I've been hunting logs on both systems and haven't found anything.
This is all the Kodi log saids:
Code: [Select]
   DEBUG: webserver: request received for /jsonrpc
   DEBUG: Previous line repeats 1 times.
   DEBUG: Thread JobWorker 12180 terminating (autodelete)
   DEBUG: webserver: request received for /jsonrpc
   DEBUG: Previous line repeats 1 times.

Does this error mean anything to you or is it something with my server?
Can you see anything there that might be a cause?
Any ideas on what other ways i can problem solve?

4
Here's a few commands to play a TV Episode by episode number from the TV Show->Season->Episode  window

Note: For this to work on all TV Shows you will need to tun off "Flatten TV show seasons" in Kodi.
Settings -> Video -> Library, change 'Flatten TV show seasons' to 'Never'. This stops Kodi displaying TV shows that only have 1 season differently to other multi season shows. The way Kodi reads these windows is different and screws up the command.


Big thanks to James for the inspiration: http://voxcommando.com/forum/index.php?topic=2059.0

How does it all work?
Everything runs from one single command "Play Episode {1}"
The other two commands will run depending on the outcome of "Play Episode {1}" command.
For this to work you need to be either watching a TV episode or viewing the episode list from the TV Show->Season.

Why bother?
1. Cause it's fun to learn all the cool stuff VC can do
2. Help others learn about how awesome Regular Expression is.
3. Cause it's nice to look at the screen and say "Play Episode 6"
4. ok, so on some systems it might be a little CPU Hungry.


Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.4.2-->
<commandGroup open="True" name="Kodi TV Show Episodes" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="751" name="Play Episode {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>XJson.Raw</cmdType>
      <params>
        <param>Player.GetActivePlayers</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)Contains(B)</ifType>
      <ifParams>{LastResult}&amp;&amp;"type": "video"</ifParams>
      <then>
        <action>
          <cmdType>VC.TellVox</cmdType>
          <params>
            <param>Play While Another Episode Currently Playing {1}</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>VC.TellVox</cmdType>
          <params>
            <param>Play from Episode List on Screen {1}</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <phrase>Play Episode</phrase>
    <payloadRange>1,30</payloadRange>
  </command>
  <command id="1509" name="Play from Epsode List on Screen" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>XJson.Raw</cmdType>
      <params>
        <param>XBMC.GetInfoLabels</param>
        <param>"labels" : ["Container.FolderPath"]</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegExSingle</cmdType>
      <params>
        <param>"Container.FolderPath": \s"videodb://tvshows/titles/*(\d.*?)/(\d.*?).*?"</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="True">
      <ifType>(A)&lt;(B)</ifType>
      <ifParams>0&amp;&amp;{Match. 1.1}</ifParams>
      <then>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <params>
            <param>Please Select TV show and Season</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>XJson.ExecBuiltin</cmdType>
          <params>
            <param>Notification(Error:, Please Select Tv Show and Season First)</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.StopMacro</cmdType>
          <params />
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else />
    </if>
    <action>
      <cmdType>XJson.Raw</cmdType>
      <params>
        <param>VideoLibrary.GetEpisodes</param>
        <param>"tvshowid":{Match.1.1}, "season":{Match.1.2}, "properties":["episode","season","tvshowid","title","showtitle"]</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegExSingle</cmdType>
      <params>
        <param>"episode":\s{1},.*?"episodeid":\s*(\d*?),.*?"label":\s"(.*?)",.*?"season":\s(\d.*?),.*?"showtitle":\s"(.*?)",.*?"title":\s"(.*?)",.*?"tvshowid":\s(\d*).*?</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="True">
      <ifType>LastActionSuccess</ifType>
      <ifParams>&amp;&amp;</ifParams>
      <then>
        <action>
          <cmdType>Results.RegExSingle</cmdType>
          <params>
            <param>"season":\s*(\d*?),.*?"showtitle":\s"(.*?)",.*?"tvshowid":\s(\d*).*?</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <params>
            <param>Sorry, I found Season {Match.1.1} but not episode {1} - of {Match.1.2}</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>XJson.ExecBuiltin</cmdType>
          <params>
            <param>Notification(Not Found: No Episode {1} Found</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>XJson.Raw</cmdType>
          <params>
            <param>Gui.ActivateWindow</param>
            <param>"window":"video","parameters":["videodb://2/2/{Match.1.3}/{Match. 1.1}/"]</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.StopMacro</cmdType>
          <params />
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else />
    </if>
    <action>
      <cmdType>XJson.Raw</cmdType>
      <params>
        <param>Player.Open</param>
        <param>"item":{"episodeid":{match.1.1}}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>Episode {1} - {Match. 1.5}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>Now playing : {Match.1.4} - {Match. 1.2}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>XJson.ExecBuiltin</cmdType>
      <params>
        <param>Notification(Now Playing:,{Match. 1.4}: {match. 1.2},5000)</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase optional="true">Do not Need to use this phase - Use 'Play Episode {1}' Command</phrase>
    <phrase>Play from Episode list on Screen</phrase>
    <payloadRange>1,50</payloadRange>
  </command>
  <command id="931" name="Play While Another Episode Currently Playing" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>XJson.Raw</cmdType>
      <params>
        <param>Player.GetItem</param>
        <param>"playerid": 1, "properties": ["title", "season", "episode", "showtitle","tvshowid" ]</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegExSingle</cmdType>
      <params>
        <param>"episode":\s*(\d.*?),.*?"season":\s*(\d.*?),.*?"tvshowid":\s*(\d*?),.*?</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>XJson.Raw</cmdType>
      <params>
        <param>VideoLibrary.GetEpisodes</param>
        <param>"tvshowid":{Match.1.3}, "season":{Match.1.2}, "properties":["episode","season","tvshowid","title","showtitle"]</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegExSingle</cmdType>
      <params>
        <param>"episode":\s{1},.*?"episodeid":\s*(\d*?),.*?"label":\s"(.*?)",.*?"season":\s(\d.*?),.*?"showtitle":\s"(.*?)",.*?"title":\s"(.*?)",.*?"tvshowid":\s(.\d.*?)}.*?</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="True">
      <ifType>LastActionSuccess</ifType>
      <ifParams>&amp;&amp;</ifParams>
      <then>
        <action>
          <cmdType>OSD.ShowText</cmdType>
          <params>
            <param>Episode {1} not Found</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <params>
            <param>Episode {1} not Found</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>XJson.ExecBuiltin</cmdType>
          <params>
            <param>Notification(Error:, No Episode {1} Found)</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.StopMacro</cmdType>
          <params />
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else />
    </if>
    <action>
      <cmdType>XJson.Raw</cmdType>
      <params>
        <param>Player.Open</param>
        <param>"item":{"episodeid":{match.1.1}}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>Now Playing: {Match.1.4} - {Match. 1.2}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>Episode {1} - {Match.1.5}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>XJson.ExecBuiltin</cmdType>
      <params>
        <param>Notification(Now Playing:,{Match. 1.4}: {match. 1.2},5000)</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase optional="true">Do not Need to use this phase - Use 'Play Episode {1}' Command</phrase>
    <phrase>Play While Another Episode Currently Playing</phrase>
    <payloadRange>1,50</payloadRange>
  </command>
</commandGroup>

I'd like to put them all in one command but it will be rather large and there's not quite the logic i need to use the error support.

If you see any improvements feel free to comment.

5
Other Plugins / Re: xMySql Return Query
« on: March 16, 2015, 08:36:04 AM »
Matches would be sweet. Something to RegEx with.

6
Other Plugins / xMySql Return Query
« on: March 15, 2015, 10:52:40 PM »
Hi,
Is it much effort, or possible, to have a MySql cmdType query?

Like an addition to the xMySql Plugin, so we can directly query a MySql server from VC and return a result to use. But nothing to do with creating a PayloadXML.

Would be really useful.  ;)

Mace

7
Now that is Awesome!!

No more words need be said.

8
Does Python in VC have a way of communicating to MySQL Database?

9
strTitle - I found my mistake there. Was reading from the kodi wiki, looks like it is still on myvideos75 information.

The XML issue, I think is just a setting I have out somewhere.

I'll have another look when I get a spare minute. Working the next few days, time is limited.

10
Quote
So, you can add this query in your xMySql plugin table as per the screen capture
I tried this but all I got was id episode and the number 1.  Must of had a setting wrong somewhere, I'll have another look later.

Quote
The problem with the "Play episode X" command is that you'll be generating a pretty large payloadXML, depending on the size of your library.
Why I was wondering if python would be more efficient.

Quote
We mostly use the "unwatched episodes of X" command, which takes us right to the next episodes of the show we want to watch. Or the "Browse season # of X", if we want to see all episodes in a particular season and choose one. So far that hasn't felt inefficient to me.
My problem with this is some times I have a habit of watching something before I put it in Kodi, so the unwatched bit doesn't always work for me, but that's just personal style.
I use browse season command a lot, but my hiccup here is i find the VC navigation commands annoying and I wouldn't even know where to start looking for my tv remote to push a button.

To me a single sentence to play what I want, is my go to option.

Should 'strTitle' be 'idShow' I'm after the tv show not the episode title?

11
Now that's some artistic genius!

I humbly bow to the master and padawan.  ;)

Next question: which is more efficient, XML or Python script?

Python script can query the database each time.....can i run a sql query directly from VC, nope. Nothing in MySql Plugin

XML, well i haven't actually worked the XML out yet. Oh wait do I generate a payload xml with each command?

Much appreciate the problem solving support. It's good fun.

12
@nime5ter
That's pretty cool, but as you can see, it's the episode name that I would like to drop.

Which makes things tricky, cause to get the right episode number we need to combine results from the episode and tvshow tables from the database.

13
That's what happens when you write stuff late at night, sounds good in my head, but not so much for everyone else.

My original play episode command was built off episode name. And works well for the most part.
As my collection has grown I'm experiencing some similarities between names and occasionally getting the wrong episode. In reality, I can live with that.

However, as I like a challenge, I'd like to try build a different way. It would be nice to play an episode by its number, rather than name. Eg:
Game of Thrones, Season 2, Episode 8.

Kodi (Xbmc) uses unique episodeid from the database to play the episodes. This id is in no way related to 'Episode 8'

As none of the above are unique in them self they can't retrieve the ' episodeid'
But if you use tv show title as a filter it narrows it down. Each show only has one 'season 2' and each season only has one 'Episode 8', combined the statement is unique. Resulting in one 'episodeid' being send to the player.

So a 4 table payload would be cool. Three phases and one value.

Retrieving a tv show title and season from Kodi is pretty easy, but to get a episodeid from an Episode numbers specific to a season which is specific to a tv show title is where the fun part is.

As I said, it's just an idea that would be cool. And I enjoy a challenge.

14
Bug Reports / Re: Group Naming conflict
« on: March 03, 2015, 09:45:53 AM »
Ah yep that would be true, cause my group and command name was the same, I was thinking group when should of said command.

Yeh invalid XML really wasn't of much help to me. Lol

Cheers

15
Haven't looked too much into this yet, just putting the idea out there.

Can I make a multi-phase payload?

Example for TV shows:
To show - season - episode = episode Id

So have a 4 table payload where 3 tables need to match to send the value.
Or maybe 4 separate payloads, all in one seems much neater.
I haven't looked much into RegEx yet, maybe it's possible.

Feel free to offer suggestions.....

Pages: [1] 2 3 ... 6