Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Support for XBMC2 plugin (formerly XBMCRepeat)

Questions and comments specific to a particular plugin should go here.
jonib
Plugin Developer
Posts: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib »

xhunter wrote:How can I add
"subtitlesearch" (preferably in fullscreen only),
movie titles ( activatewindow(videos,movietitles) ),
or tv titles ( activatewindow(videos,movietitles)) ?
You need to use more words if you want any help from me, I have a policy not to read anyone's mind to figure out what they want/need.
Don't have time right now anyway (Going to bed).

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
xhunter
Posts: 14
Joined: Wed Apr 13, 2016 11:17 pm

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by xhunter »

Hi,
I am really sorry that I wasn't clear.
I thought as this plugin executes xbmc/kodi commands, it would be enough to just mention those commands (they could probably be new),

there are actions that I use in keymaps that I thought it would be useful to be able to use them through my remote

Keymap
one for example is "subtitlesearch / activatewindow(subtitlesearch)" (WINDOW_DIALOG_SUBTITLES), I have assigned the button "S" in "fullscreenvideo" on my keyboard and when pressed it brings up the online subtitle search. I would love it if I could assign the teletext button on my remote to do the same thing,

another thing that I can do with my keyboard is to open "videos" directly in "TvShowTitles" and "MovieTitles", that would take me directly to the "titles", it is the default behavior when you select "Movies" or "TV Shows" in the home menu. so I thought it would be great if I could get there using my remote but I can't find a way doing that using your plugin.

Opening Windows and Dialogs
xhunter
Posts: 14
Joined: Wed Apr 13, 2016 11:17 pm

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by xhunter »

sorry,
found the last two ("TvShowTitles" & "MovieTitle"), I was usning "Remote->My TV" & "Remote->My Video",
I found it under "Windows" , "Show TV Shows Screen" & "Show Movies Screen",

still I don't think there is anything that executes a subtitle search.

thanks.
jonib
Plugin Developer
Posts: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib »

xhunter wrote:I am really sorry that I wasn't clear.
I thought as this plugin executes xbmc/kodi commands, it would be enough to just mention those commands (they could probably be new),
The problem with your first post was that I didn't know ware you asking to add new(missing) commands or how to use the existing commands or something else. So when you are asking for help/assistance it's your job to make it as clear and specific what you need, so someone like my don't have to put unnecessary effort in figuring it out, and potentially just not responding at all.

And Kodi supports a lot of commands in different ways, so I don't remember every command that my plugin supports off hand.
found the last two ("TvShowTitles" & "MovieTitle"), I was usning "Remote->My TV" & "Remote->My Video",
I found it under "Windows" , "Show TV Shows Screen" & "Show Movies Screen",
OK, good.
still I don't think there is anything that executes a subtitle search.
This might work JSON-RPC command for subtitle search.
Unfortunately I didn't get a email notification about your reply and now it's late again, I'll check tomorrow.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
xhunter
Posts: 14
Joined: Wed Apr 13, 2016 11:17 pm

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by xhunter »

I understand, thanks for the efforts.
jonib wrote: This might work JSON-RPC command for subtitle search.
that actually did the trick,
it took me a while to figure out how JSON-RPC works, how to enable it and update it etc.., but eventually I was able to make it work.

thank you,

one question, do you think it is possible to check kodi state and only if it's in "fullscreenvideo" (video playback screen), execute this command?

I have gone as far as getting the status using "GUI > GetProperties > {"properties":["currentwindow"]}" returning :

Code: Select all

   Result:
   {
     "currentwindow": {
       "id": 12005, 
       "label": "Fullscreen video"
     }
   } 
but I don't know how to interpret that.
jonib
Plugin Developer
Posts: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib »

xhunter wrote:that actually did the trick,
Great.
it took me a while to figure out how JSON-RPC works, how to enable it and update it etc.., but eventually I was able to make it work.
Yeah there needs to be better documentation, but unless someone writes it there won't be. :cry:
one question, do you think it is possible to check kodi state and only if it's in "fullscreenvideo" (video playback screen), execute this command?
This is how I do it:
JSON-RPC action: GUI.GetProperties with parameter:

Code: Select all

[["fullscreen"]]
Then a Python script action:

Code: Select all

if eg.result["fullscreen"] == True:
    eg.result = True
else:
    eg.result = False
Then a Jump action to another macro based on the result.

I can elaborate if this is not enough.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
xhunter
Posts: 14
Joined: Wed Apr 13, 2016 11:17 pm

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by xhunter »

jonib wrote:This is how I do it:
JSON-RPC action: GUI.GetProperties with parameter:

Code: Select all

[["fullscreen"]]
Then a Python script action:

Code: Select all

if eg.result["fullscreen"] == True:
    eg.result = True
else:
    eg.result = False
Then a Jump action to another macro based on the result.
Thank you very much, I got it working, even through I didn't understand how "[["fullscreen"]]" was able to get the fullscreenvideo status, but it's working perfectly as it should.

I, myself, was trying to get it done in Python by getting the current window with this:

Code: Select all

eg.plugins.XBMC2.JSONRPC(u'GUI.Getproperties', u'"properties",["currentwindow"]', False)
but all I was getting was "invalid type string received"

thanks again.
jonib
Plugin Developer
Posts: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib »

xhunter wrote:Thank you very much, I got it working,
Good.
even through I didn't understand how "[["fullscreen"]]" was able to get the fullscreenvideo status, but it's working perfectly as it should.

but all I was getting was "invalid type string received"
Kodi JSON-RPC parameters can be "ByName" (uses {}) or "ByPosition" (uses []), GUI.Getproperties takes one parameter so my example is "ByPosition"

Code: Select all

[["fullscreen"]]
So it don't need the "properties" parameter name.

So your code was missing a colon (:) that is needed to separate the parameter name and value:

Code: Select all

eg.plugins.XBMC.JSONRPC(u'GUI.Getproperties', u'"properties":["currentwindow"]', False)
Or you can skip the "properties" part and surround it with []:

Code: Select all

eg.plugins.XBMC.JSONRPC(u'GUI.Getproperties', u'[["currentwindow"]]', False)
With other commands that have more parameters and you use "ByName" the order of the parameters doesn't matter and you can skip optional parameters, if you use "ByPosition" they need to be in exactly the right order and you can't skip parameters from the middle only from the end.

Edit:
Sometimes you can skip the "{}" or "[]" like if the parameter is only one string or number or something non ambiguous.
For example you can't remove the [] from this [["fullscreen"]] as the plugin wouldn't know its supposed to be a list of strings.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
xhunter
Posts: 14
Joined: Wed Apr 13, 2016 11:17 pm

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by xhunter »

jonib wrote:Kodi JSON-RPC parameters can be "ByName" (uses {}) or "ByPosition" (uses []), GUI.Getproperties takes one parameter so my example is "ByPosition"

Code: Select all

[["fullscreen"]]
So it don't need the "properties" parameter name.

So your code was missing a colon (:) that is needed to separate the parameter name and value:

Code: Select all

eg.plugins.XBMC.JSONRPC(u'GUI.Getproperties', u'"properties":["currentwindow"]', False)
Or you can skip the "properties" part and surround it with []:

Code: Select all

eg.plugins.XBMC.JSONRPC(u'GUI.Getproperties', u'[["currentwindow"]]', False)
With other commands that have more parameters and you use "ByName" the order of the parameters doesn't matter and you can skip optional parameters, if you use "ByPosition" they need to be in exactly the right order and you can't skip parameters from the middle only from the end.

Edit:
Sometimes you can skip the "{}" or "[]" like if the parameter is only one string or number or something non ambiguous.
For example you can't remove the [] from this [["fullscreen"]] as the plugin wouldn't know its supposed to be a list of strings.

jonib
Thank you very much, you have been a great help to me, chears.
(I did try the colon (:), but it was giving me invalid syntax, that's why I tried comma (,).)

by the way, did you ever find a solution or a workaround for the problem with some of the windows like subtitle search locking up eventghost 60 sec timeout

I didn't notice it because kodi was downloading the first subtitle automatically and the window was disappearing, then I ran into a video for which there was no subtitle, that's when I noticed I can't do anything with the remote,

I can't find the not wait option for JSON-RPC and so far nothing I have tried has worked, even tried creating 3 three timers with the timer plugin trying to abort the timer that initiated the subtitle search, but nothing has worked so far.
jonib
Plugin Developer
Posts: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib »

xhunter wrote:(I did try the colon (:), but it was giving me invalid syntax, that's why I tried comma (,).)
Do you still have the colon problem?
by the way, did you ever find a solution or a workaround for the problem with some of the windows like subtitle search locking up eventghost 60 sec timeout
It was a while ago, but I believe it's a internal Kodi problem, where some functionality just isn't handled well when accessed externally. A discussion on Kodi forum.
I'll see if there is a workaround, but I think Kodi needs fixing.
I can't find the not wait option for JSON-RPC and so far nothing I have tried has worked, even tried creating 3 three timers with the timer plugin trying to abort the timer that initiated the subtitle search, but nothing has worked so far.
Every JSON-RPC action should have a checkbox to disable the wait for that action.

Edit: Apparently it was too late yesterday as this post was half done only. :oops:

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
xhunter
Posts: 14
Joined: Wed Apr 13, 2016 11:17 pm

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by xhunter »

jonib wrote:Do you still have the colon problem?
yes it still gives an invalid syntax error while the 2nd one without colon works just fine

Code: Select all

eg.plugins.XBMC2.JSONRPC(u'GUI.Getproperties', u'"properties":["currentwindow"]', False)

Code: Select all

   Traceback (most recent call last):
     Python script "8", line 1, in <module>
       eg.plugins.XBMC2.JSONRPC(u'GUI.Getproperties', u'"properties":["currentwindow"]', False)
     File "C:\Program Files (x86)\EventGhost\plugins\XBMCRepeat\__init__.py", line 991, in __call__
       responce = self.plugin.JSON_RPC.send(method, ast.literal_eval(ParseString2(param)))
     File "ast.pyc", line 49, in literal_eval
     File "ast.pyc", line 37, in parse
   SyntaxError: invalid syntax (<unknown>, line 1)
Edit:
this one works with the curly brackets :)

Code: Select all

eg.plugins.XBMC2.JSONRPC(u'GUI.Getproperties', u'{"properties":["currentwindow"]}', False)
jonib wrote:It was a while ago, but I believe it's a internal Kodi problem, where some functionality just isn't handled well when accessed externally. A discussion on Kodi forum.
I'll see if there is a workaround, but I think Kodi needs fixing.

Every JSON-RPC action should have a checkbox to disable the wait for that action.
I hope this problem can be resolved somehow.

I am using the the latest "EventGhost 0.4.1.r1722" (don't know if I should update the plugin manually), but I can't seem to find the wait for the action checkbox, I only see a "show result in the log" check box. maybe I am missing something.

if this option can resolve our problem, that would be wonderful.
jonib wrote:Edit: Apparently it was too late yesterday as this post was half done only. :oops:.


Thanks for all the help :)
xhunter
Posts: 14
Joined: Wed Apr 13, 2016 11:17 pm

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by xhunter »

jonib wrote:Every JSON-RPC action should have a checkbox to disable the wait for that action.
sorry for the trouble, found the ver 0.6.33 and updated it, all seems to be order,
found the option you were talking about and it seems to have solved the problem :)

I am grateful for your help :)
jonib
Plugin Developer
Posts: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib »

xhunter wrote:sorry for the trouble, found the ver 0.6.33 and updated it, all seems to be order,
found the option you were talking about and it seems to have solved the problem :)
Great. so stuff are working like you want it?
I assumed you had a newer version as you linked to the version I added that option, I need to check what needs fixing in the plugin and then have Pako put the new version in EventGhost as the version right now seems a bit old.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
xhunter
Posts: 14
Joined: Wed Apr 13, 2016 11:17 pm

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by xhunter »

jonib wrote:Great. so stuff are working like you want it?
I assumed you had a newer version as you linked to the version I added that option, I need to check what needs fixing in the plugin and then have Pako put the new version in EventGhost as the version right now seems a bit old.

jonib
yes things are perfect, though after the update (tried clean installing), I get "XBMC2: Error opening: actions.dat" every time I start eventghost, but everything works just fine.

it was my bad, I sort of had this idea in my mind that because I installed the latest exe, I should have the latest plugins :)

thanks again.
jonib
Plugin Developer
Posts: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib »

xhunter wrote:though after the update (tried clean installing), I get "XBMC2: Error opening: actions.dat" every time I start eventghost, but everything works just fine.
Yeah, that's one of the things I need to fix. Basically the webpage that the plugin uses to add missing actions has changed format so it can't update, also I'll hide the missing file error unless debugging is active. So no need to show it if the user isn't using it anyway.
it was my bad, I sort of had this idea in my mind that because I installed the latest exe, I should have the latest plugins :)
I'll try to update the plugin in EventGhost more often, I just don't want to add it if it's not properly tested, if I don't get enough feedback when I fix or add features.

Some plugins are updated more often then EventGhost so it's good to check that you are using the latest version if there are problems.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
Post Reply