Support for XBMC2 plugin (formerly XBMCRepeat)

Questions and comments specific to a particular plugin should go here.

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Postby jonib » Sat May 19, 2012 2:22 pm

peppe_sr wrote:i would like to have a command to clean library from remote i found in the List of built-in functions this command: CleanLibrary(database). is there a way to set a command in the xbmc2 list to do this.
Sure :D . Unfortunately I haven't finished adding the built-in functions directly, but you can still use them via the Experimental\HTTPAPI action with command ExecBuiltIn using CleanLibrary(video) as parameter.
XBMC2CleanLibrary.PNG
If you haven't used the HTTPAPI action before you need to press the Update button to download the syntax information, if that don't work you can still put in the command manually.

Hope this helps.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
jonib
Plugin Developer
 
Posts: 728
Joined: Thu Mar 26, 2009 9:33 pm

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Postby Livin » Sat May 19, 2012 3:51 pm

jonib wrote:
Livin wrote:in order to trigger home automation events, including the type is essential.
Jupp, I'll add it in the next test version, I just don't want to make too many special cases based on the events, as I want my plugin to work with any events that XBMC supports. That said I still want the events to be as easy/usable as possible in EventGhost, it's just not straightforward always.
Also, will XBMC send notifications based on what Home menu item is chosen (TV Shows, Movies, Music, Photos, etc)?
Sorry haven't seen any events like that. But I have only tested with the current release of XBMC, so there might be more events in the development version as there seems to be lot of changes in the JSON-RPC code.
Edit: Looks like XBMC 12.0 alpha don't either.

jonib


Any ETA on the next test version? I will finally have some time to test next week. My Vera is running well so I'm anxious to get them integrated...

I wish we had a Vera plugin for JSON to go directly to XBMC - but we don't. :(
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system
User avatar
Livin
Experienced User
 
Posts: 749
Joined: Wed Oct 08, 2008 4:56 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Postby jonib » Sat May 19, 2012 5:54 pm

Livin wrote:Any ETA on the next test version?
I'll see if I can finish it up this weekend.

I need to fix at least one infinite loop and add the media type to the event string, might need to do some other tweaks. Any comments related to the last test version would be appreciated so I know if there are anything else that needs fixing/adding.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
jonib
Plugin Developer
 
Posts: 728
Joined: Thu Mar 26, 2009 9:33 pm

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Postby jonib » Sat May 19, 2012 7:34 pm

I have attached a new test version.

I have hopefully fixed the infinite loop I was getting when there was a socket error, but now if that happens there won't be any more JSON events until reactivated.
I have added the media type to the event string, so it can be used to activate different macros depending on the media type.
I removed the JSONRPC part from the event string as I don't think it's needed.

Some example events: First three I played a TV episode, next three is from playing a video from the Youtube plugin and the last four when I played a random video file that's not in XBMCs library.
Code: Select all
XBMC.Player.OnPlay.episode {u'item': {u'id': 15182}, u'player': {u'playerid': 1, u'speed': 1}}
XBMC.Player.OnStop.episode {u'item': {u'id': 15182}}
XBMC.VideoLibrary.OnUpdate.episode {u'item': {u'id': 15182}}

XBMC.Player.OnPlay.movie {u'title': u'Diablo 3, Max Payne 3, and more! This Week on Rev3Games', u'player': {u'playerid': 1, u'speed': 1}}
XBMC.Player.OnPause.movie {u'title': u'Diablo 3, Max Payne 3, and more! This Week on Rev3Games', u'player': {u'playerid': 1, u'speed': 0}}
XBMC.Player.OnStop.movie {u'title': u'Diablo 3, Max Payne 3, and more! This Week on Rev3Games'}

XBMC.Player.OnPlay.movie {u'title': u'', u'player': {u'playerid': 1, u'speed': 1}}
XBMC.Player.OnSpeedChanged.movie {u'title': u'', u'player': {u'playerid': 1, u'speed': 2}}
XBMC.Player.OnSpeedChanged.movie {u'title': u'', u'player': {u'playerid': 1, u'speed': 1}}
XBMC.Player.OnStop.movie {u'title': u''}


jonib
Attachments
__init__.py
(82.65 KiB) Downloaded 111 times
XBMC2 plugin to control XBMC. If you want to flatter me Image
jonib
Plugin Developer
 
Posts: 728
Joined: Thu Mar 26, 2009 9:33 pm

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Postby Livin » Sun May 20, 2012 3:31 am

jonib,
I've done very basic testing.. so far, I think it is mostly working but I've found a few item I'd like you to look at. It might be a bug in XBMC, not sure...

The 1st and 2nd videos were movie from my XBMC library, logged properly - all is good
Then I chose a video from a file share, not from the XBMC library, shown at 20:12:05 - log does not display any 'file name' or 'type'.
Then I chose a video from the TV portion of my XBMC library, shown at 20:12:55 - log displays its as a Movie (it is an TV Show episode and shows as such in the library) but does show the Episode name properly. It wold be nice if it logged the Show Name & Episode Title

Let me know what you think?

20:06:54 Raw event: '<b>OnPlayBackStarted;192.168.2.11;1</b>' ('192.168.2.11', 54239)
20:06:54 EVENT: XBMC2.Broadcast.OnPlayBackStarted
20:06:54 EVENT: Task.Deactivated.EventGhost
20:06:54 EVENT: Task.Activated.XBMC
20:06:54 MACRO: Enable (automatic)
20:06:54 ACTION: Enable: WMC Start Functions
20:06:54 ACTION: Enable exclusive: XBMC controls
20:06:54 ACTION: Trigger event "video.settings.xbmc"
20:06:54 EVENT: Main.video.settings.xbmc
20:06:55 Raw event: '<b>MediaChanged:<li>MovieTitle:Dirty Rotten Scoundrels;192.168.2.11;1</b>' ('192.168.2.11', 54239)
20:06:55 EVENT: XBMC2.Broadcast.MediaChanged.MovieTitle u"Dirty Rotten Scoundrels"
20:08:12 EVENT: Task.Deactivated.XBMC
20:08:12 MACRO: Disable (automatic)
20:08:12 ACTION: Enable: XBMC Start Functions
20:08:12 ACTION: Disable: XBMC controls
20:08:12 EVENT: Task.Activated.Desktop
20:08:32 EVENT: Task.Deactivated.Desktop
20:08:32 EVENT: Task.Activated.EventGhost
20:09:36 EVENT: System.Idle
20:10:38 EVENT: System.UnIdle
20:10:40 EVENT: Task.Deactivated.EventGhost
20:10:40 EVENT: Task.Activated.Desktop
20:10:49 EVENT: Task.Deactivated.Desktop
20:10:49 EVENT: Task.Activated.EventGhost
20:10:54 MACRO: XBMC - close
20:10:54 ACTION: XBMC2: Quit
20:10:54 ACTION: Find Window: XBMC.exe
20:10:54 ACTION: Kill XBMC process
20:10:54 EVENT: Task.Created.cmd
20:10:54 EVENT: Task.NewWindow.cmd
20:10:54 EVENT: Task.Deactivated.EventGhost
20:10:54 EVENT: Task.Activated.cmd
20:10:54 EVENT: Task.ClosedWindow.XBMC
20:10:54 MACRO: Disable (automatic)
20:10:54 ACTION: Enable: XBMC Start Functions
20:10:54 ACTION: Disable: XBMC controls
20:10:54 EVENT: Task.Destroyed.XBMC
20:10:54 MACRO: Disable (automatic)
20:10:54 ACTION: Enable: XBMC Start Functions
20:10:54 ACTION: Disable: XBMC controls
20:10:54 EVENT: Task.Deactivated.cmd
20:10:54 EVENT: Task.ClosedWindow.cmd
20:10:54 EVENT: Task.Destroyed.cmd
20:10:55 EVENT: Task.Activated.EventGhost
20:10:58 EVENT: Task.Created.XBMC
20:10:58 EVENT: Task.NewWindow.XBMC
20:10:58 EVENT: Task.Deactivated.EventGhost
20:10:58 EVENT: Task.Activated.XBMC
20:10:58 MACRO: Enable (automatic)
20:10:58 ACTION: Enable: WMC Start Functions
20:10:58 ACTION: Enable exclusive: XBMC controls
20:10:58 ACTION: Trigger event "video.settings.xbmc"
20:10:58 EVENT: Main.video.settings.xbmc
20:11:03 Raw event: '<b>StartUp;192.168.2.11;1</b>' ('192.168.2.11', 56165)
20:11:03 EVENT: XBMC2.Broadcast.StartUp
20:11:18 Raw event: '<b>OnPlayBackStarted;192.168.2.11;1</b>' ('192.168.2.11', 56165)
20:11:18 EVENT: XBMC2.Broadcast.OnPlayBackStarted
20:11:18 Raw event: '<b>MediaChanged:<li>MovieTitle:A Bronx Tale;192.168.2.11;1</b>' ('192.168.2.11', 56165)
20:11:18 EVENT: XBMC2.Broadcast.MediaChanged.MovieTitle u"A Bronx Tale"
20:11:37 Raw event: '<b>OnAction:13;192.168.2.11;2</b>' ('192.168.2.11', 56165)
20:11:37 Raw event: '<b>OnPlayBackStopped;192.168.2.11;1</b>' ('192.168.2.11', 56165)
20:11:37 EVENT: XBMC2.Broadcast.OnAction.ACTION_STOP
20:11:37 EVENT: XBMC2.Broadcast.OnPlayBackStopped
20:11:59 EVENT: System.Idle
20:12:05 Raw event: '<b>OnPlayBackStarted;192.168.2.11;1</b>' ('192.168.2.11', 56165)
20:12:05 EVENT: XBMC2.Broadcast.OnPlayBackStarted
20:12:06 EVENT: OnkyoSerial.ListeningModes.Surround51ch
20:12:13 Raw event: '<b>OnAction:13;192.168.2.11;2</b>' ('192.168.2.11', 56165)
20:12:13 Raw event: '<b>OnPlayBackStopped;192.168.2.11;1</b>' ('192.168.2.11', 56165)
20:12:13 EVENT: XBMC2.Broadcast.OnAction.ACTION_STOP
20:12:13 EVENT: XBMC2.Broadcast.OnPlayBackStopped
20:12:55 Raw event: '<b>OnPlayBackStarted;192.168.2.11;1</b>' ('192.168.2.11', 56165)
20:12:55 EVENT: XBMC2.Broadcast.OnPlayBackStarted
20:12:55 Raw event: '<b>MediaChanged:<li>MovieTitle:Puerto Rico;192.168.2.11;1</b>' ('192.168.2.11', 56165)
20:12:55 EVENT: XBMC2.Broadcast.MediaChanged.MovieTitle u"Puerto Rico"
20:12:55 EVENT: OnkyoSerial.ListeningModes.PLIIMusic
20:13:02 Raw event: '<b>OnAction:13;192.168.2.11;2</b>' ('192.168.2.11', 56165)
20:13:02 Raw event: '<b>OnPlayBackStopped;192.168.2.11;1</b>' ('192.168.2.11', 56165)
20:13:02 EVENT: XBMC2.Broadcast.OnAction.ACTION_STOP
20:13:02 EVENT: XBMC2.Broadcast.OnPlayBackStopped
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system
User avatar
Livin
Experienced User
 
Posts: 749
Joined: Wed Oct 08, 2008 4:56 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Postby jonib » Sun May 20, 2012 11:49 am

Livin wrote:Let me know what you think?
You only seem to get broadcast events and not JSON-RPC events, did you activate them with the JSONRPCEventsConnect action?
Read the post for the last test version for more instructions.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
jonib
Plugin Developer
 
Posts: 728
Joined: Thu Mar 26, 2009 9:33 pm

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Postby Livin » Sun May 20, 2012 5:38 pm

OK, I installed the Macro for JSON activation. I now get the JSON events but the problems persist - even if raw events is on or off. And, it always pulls broadcast events even when I turned it off in the plugin settings.

Code: Select all
2012-05-20 10:29:37        ACTION: Enable: XBMC Start Functions
2012-05-20 10:29:37        ACTION: Disable: XBMC controls
2012-05-20 10:29:37  EVENT: Task.Activated.EventGhost
2012-05-20 10:30:45  EVENT: Task.Deactivated.EventGhost
2012-05-20 10:30:45  EVENT: Task.Activated.XBMC
2012-05-20 10:30:45     MACRO: Enable (automatic)
2012-05-20 10:30:45        ACTION: Enable: WMC Start Functions
2012-05-20 10:30:45        ACTION: Enable exclusive: XBMC controls
2012-05-20 10:30:45        ACTION: Trigger event "video.settings.xbmc"
2012-05-20 10:30:45     MACRO: XBCM - enable JSON
2012-05-20 10:30:45        ACTION: XBMC2: JSONRPCEventsConnect
2012-05-20 10:30:45           Already connecting.
2012-05-20 10:30:45  EVENT: Main.video.settings.xbmc
2012-05-20 10:31:36  Raw event: '<b>OnPlayBackStarted;192.168.2.11;1</b>' ('192.168.2.11', 64575)
2012-05-20 10:31:37  EVENT: XBMC2.Broadcast.OnPlayBackStarted
2012-05-20 10:31:37  Raw event: {u'params': {u'data': {u'item': {u'type': u'movie'}, u'title': u'', u'player': {u'playerid': 1, u'speed': 1}}, u'sender': u'xbmc'}, u'jsonrpc': u'2.0', u'method': u'Player.OnPlay'}
2012-05-20 10:31:37  EVENT: XBMC2.Player.OnPlay.movie {u'title': u'', u'player': {u'playerid': 1, u'speed': 1}}
2012-05-20 10:32:02  Raw event: {u'params': {u'data': {u'item': {u'type': u'movie'}, u'title': u''}, u'sender': u'xbmc'}, u'jsonrpc': u'2.0', u'method': u'Player.OnStop'}
2012-05-20 10:32:02  EVENT: XBMC2.Player.OnStop.movie {u'title': u''}
2012-05-20 10:32:02  Raw event: '<b>OnAction:13;192.168.2.11;2</b>' ('192.168.2.11', 64575)
2012-05-20 10:32:03  Raw event: '<b>OnPlayBackStopped;192.168.2.11;1</b>' ('192.168.2.11', 64575)
2012-05-20 10:32:03  EVENT: XBMC2.Broadcast.OnAction.ACTION_STOP
2012-05-20 10:32:03  EVENT: XBMC2.Broadcast.OnPlayBackStopped
2012-05-20 10:32:59  EVENT: System.Idle
2012-05-20 10:33:21  Raw event: {u'params': {u'data': {u'item': {u'type': u'episode', u'id': 1}, u'player': {u'playerid': 1, u'speed': 1}}, u'sender': u'xbmc'}, u'jsonrpc': u'2.0', u'method': u'Player.OnPlay'}
2012-05-20 10:33:21  EVENT: XBMC2.Player.OnPlay.episode {u'item': {u'id': 1}, u'player': {u'playerid': 1, u'speed': 1}}
2012-05-20 10:33:21  Raw event: '<b>OnPlayBackStarted;192.168.2.11;1</b>' ('192.168.2.11', 64575)
2012-05-20 10:33:21  EVENT: XBMC2.Broadcast.OnPlayBackStarted
2012-05-20 10:33:21  Raw event: '<b>MediaChanged:<li>MovieTitle:Texas;192.168.2.11;1</b>' ('192.168.2.11', 64575)
2012-05-20 10:33:21  EVENT: XBMC2.Broadcast.MediaChanged.MovieTitle u"Texas"
2012-05-20 10:33:22  EVENT: OnkyoSerial.ListeningModes.PLIIMusic
2012-05-20 10:33:39  EVENT: System.UnIdle
2012-05-20 10:33:42  Raw event: {u'params': {u'data': {u'item': {u'type': u'episode', u'id': 1}}, u'sender': u'xbmc'}, u'jsonrpc': u'2.0', u'method': u'Player.OnStop'}
2012-05-20 10:33:42  EVENT: XBMC2.Player.OnStop.episode {u'item': {u'id': 1}}
2012-05-20 10:33:43  Raw event: '<b>OnAction:13;192.168.2.11;2</b>' ('192.168.2.11', 64575)
2012-05-20 10:33:43  Raw event: '<b>OnPlayBackStopped;192.168.2.11;1</b>' ('192.168.2.11', 64575)
2012-05-20 10:33:43  EVENT: XBMC2.Broadcast.OnAction.ACTION_STOP
2012-05-20 10:33:43  EVENT: XBMC2.Broadcast.OnPlayBackStopped
2012-05-20 10:33:43  Raw event: {u'params': {u'data': {u'item': {u'type': u'episode', u'id': 1}}, u'sender': u'xbmc'}, u'jsonrpc': u'2.0', u'method': u'VideoLibrary.OnUpdate'}
2012-05-20 10:
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system
User avatar
Livin
Experienced User
 
Posts: 749
Joined: Wed Oct 08, 2008 4:56 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Postby blaher » Mon May 21, 2012 7:30 am

Thanks for including the media type; it's really useful. :)

I found one bug, I think, I get the following when a movie plays through to the end, either:

XBMC2.Player.OnStop.unknown {}
or
XBMC2.Player.OnStop

The following all work when you do it manually:
XBMC2.Player.OnPause.movie
XBMC2.Player.OnStop.movie
XBMC2.Player.OnPlay.movie

The same for TV episodes, it says XBMC2.Player.OnStop, instead of XBMC2.Player.OnStop.episode if it's not a manual stop.

Hope that helps.
blaher
Experienced User
 
Posts: 152
Joined: Thu Nov 17, 2011 1:27 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Postby jonib » Mon May 21, 2012 11:05 am

blaher wrote:The same for TV episodes, it says XBMC2.Player.OnStop, instead of XBMC2.Player.OnStop.episode if it's not a manual stop.
That is/was a bug in XBMC see my ticket, it should be fixed in today's nightly build of XBMC.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
jonib
Plugin Developer
 
Posts: 728
Joined: Thu Mar 26, 2009 9:33 pm

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Postby Livin » Mon May 21, 2012 3:03 pm

So it seems that only after a restart of my PC would the Broadcast events stopped logging - Not worried but just something to note.

Also, can you look at what happens when you play a video from a file share - one that is not scanned into your library?

Seems that it is logging all of my normal files (not in XBMC's library) as 'movie' - as such...

EVENT: XBMC2.Player.OnPlay.movie {u'title': u'', u'player': {u'playerid': 1, u'speed': 1}}
EVENT: XBMC2.Player.OnSeek.movie {u'title': u'', u'player': {u'playerid': 1, u'seekoffset': {u'hours': 0, u'seconds': 30, u'minutes': 0, u'milliseconds': 0}, u'speed': 1, u'time': {u'hours': 0, u'seconds': 32, u'minutes': 13, u'milliseconds': 967}}}
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system
User avatar
Livin
Experienced User
 
Posts: 749
Joined: Wed Oct 08, 2008 4:56 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Postby jonib » Mon May 21, 2012 6:13 pm

Livin wrote:So it seems that only after a restart of my PC would the Broadcast events stopped logging - Not worried but just something to note.
Haven't had a chance to look at this, probably a simple fix.

Also, can you look at what happens when you play a video from a file share - one that is not scanned into your library?
Unfortunately any normal file not in the library or from a plugin has very limited info in the events. here's a response I got when asked about it in the XBMC forum.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
jonib
Plugin Developer
 
Posts: 728
Joined: Thu Mar 26, 2009 9:33 pm

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Postby Livin » Mon May 21, 2012 6:44 pm

jonib wrote:Unfortunately any normal file not in the library or from a plugin has very limited info in the events. here's a response I got when asked about it in the XBMC forum.


... and my reply -- http://forum.xbmc.org/showthread.php?ti ... pid1108361
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system
User avatar
Livin
Experienced User
 
Posts: 749
Joined: Wed Oct 08, 2008 4:56 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Postby jonib » Mon May 21, 2012 9:33 pm

Livin wrote:but does show the Episode name properly. It wold be nice if it logged the Show Name & Episode Title
Is this the problem you had even after you activated the JSON-RPC events?
If so you can use the Experimental\JSONRPC\VideoLibrary.GetEpisodeDetails and Experimental\JSONRPC\VideoLibrary.GetTVShowDetails actions.
I can give you example commands if you need.

So it seems that only after a restart of my PC would the Broadcast events stopped logging - Not worried but just something to note.
I was not able to reproduce this, if you can reproduce the problem I'll look into it.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
jonib
Plugin Developer
 
Posts: 728
Joined: Thu Mar 26, 2009 9:33 pm

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Postby Livin » Mon May 21, 2012 11:25 pm

jonib wrote:
Livin wrote:but does show the Episode name properly. It wold be nice if it logged the Show Name & Episode Title
Is this the problem you had even after you activated the JSON-RPC events?
If so you can use the Experimental\JSONRPC\VideoLibrary.GetEpisodeDetails and Experimental\JSONRPC\VideoLibrary.GetTVShowDetails actions.
I can give you example commands if you need.

Examples please :)

jonib wrote:So it seems that only after a restart of my PC would the Broadcast events stopped logging - Not worried but just something to note.
I was not able to reproduce this, if you can reproduce the problem I'll look into it.[/quote]
might have been a fluke.
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system
User avatar
Livin
Experienced User
 
Posts: 749
Joined: Wed Oct 08, 2008 4:56 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Postby jonib » Tue May 22, 2012 12:37 am

Livin wrote:Examples please :)
I don't have much time right now so hope these work, if you need I'll post other examples tomorrow.

OK, this first one is a macro paste it somewhere in your EventGhost config:
Code: Select all
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1568">
    <Macro Name="XBMC2 #: JSONRPC: get showname and episodename" Expanded="True">
        <Event Name="XBMC2.Player.OnPlay.episode" />
        <Action>
            XBMC2.JSONRPC(u'VideoLibrary.GetEpisodeDetails', u"[{{eg.event.payload['item']['id']}},['tvshowid']]", True)
        </Action>
        <Action>
            XBMC2.JSONRPC(u'VideoLibrary.GetTVShowDetails', u"[{{eg.result['episodedetails']['tvshowid']}}]", True)
        </Action>
        <Action>
            EventGhost.ShowOSD(u"{eg.result['tvshowdetails']['label']}", u'0;-24;0;0;0;700;0;0;0;1;0;0;2;32;Arial', (255, 255, 255), (0, 0, 0), 0, (0, 0), 1, 3.0, False)
        </Action>
    </Macro>
</EventGhost>
The macro will react to a XBMC2.Player.OnPlay.episode event. The first JSONRPC action will use the episodeid from the event payload and it returns information about the episode, including the tvshowid that is needed in the second JSON-RPC action. The second JSON-RPC action returns information about the show.
The ShowOSD action should display the show name.


The code below is similar but needs to be put in a Python script action, it shows it's easier to get both episode name and show name when using a script.
Code: Select all
Episode = eg.plugins.XBMC2.JSONRPC(u'VideoLibrary.GetEpisodeDetails', u"["+str(eg.event.payload['item']['id'])+",['tvshowid']]", False)
print 'Episode:',Episode['episodedetails']['label']
Show = eg.plugins.XBMC2.JSONRPC(u'VideoLibrary.GetTVShowDetails', u"["+str(Episode['episodedetails']['tvshowid'])+"]", False)
print 'Show:',Show['tvshowdetails']['label']

eg.result = Show['tvshowdetails']['label']+': '+Episode['episodedetails']['label']
If you put this in a Python script and below it a ShowOSD action with this {eg.result} in the text area it should show both show title and episode name.


If these examples are hard to follow give me a specific example how you want to use the information and I'll make a better example.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
jonib
Plugin Developer
 
Posts: 728
Joined: Thu Mar 26, 2009 9:33 pm

PreviousNext

Return to Plugin Support

Who is online

Users browsing this forum: No registered users and 3 guests