@@ -87,10 +87,11 @@ def onPlayBackStopped(self):
8787 imdb = movie .getIMDBNumber ().strip (" " )
8888 fname = self .getPlayingFile ()
8989 thing = xbmc .executeJSONRPC (json .dumps ({"jsonrpc" : "2.0" , "method" : "Player.GetItem" ,
90- "params" : { "properties" : [ "showtitle" , "title" ]
90+ "params" : { "properties" : [ "showtitle" , "title" , "season" , "episode" ]
9191 , "playerid" : 1 }, "id" : "VideoGetItem" }))
9292 xbmc .log ("Simkl: Full: {}" .format (thing ))
93- media = json .loads (thing )["result" ]["item" ]["type" ]
93+ item = json .loads (thing )["result" ]["item" ]
94+ media = item ["type" ]
9495 xbmc .log ("Simkl: IMDb: {}" .format (imdb ))
9596 xbmc .log ("Simkl: Genre: " + movie .getGenre ())
9697 xbmc .log ("Simkl: MediaType: " + str (media ))
@@ -112,8 +113,13 @@ def onPlayBackStopped(self):
112113 r = self .api .watched (imdb , media , self .getTotalTime ())
113114
114115 if bubble and r :
115- interface .notify (getstr (32028 ).format (
116- json .loads (thing )["result" ]["item" ]["label" ]))
116+ txt = item ["label" ]
117+ title = ""
118+ if media == "movie" : txt = item ["title" ]
119+ elif media == "episode" :
120+ txt = item ["showtitle" ]
121+ title = "- S{:02}E{:02}" .format (item ["season" ], item ["episode" ])
122+ interface .notify (getstr (32028 ).format (title ), title = txt )
117123 r = 0
118124
119125 except RuntimeError :
0 commit comments