2016-01-12 02:53:41 +11:00
|
|
|
# -*- coding: utf-8 -*-
|
2016-10-23 02:15:10 +11:00
|
|
|
###############################################################################
|
2018-02-16 05:47:01 +11:00
|
|
|
from sys import listitem
|
|
|
|
from urllib import urlencode
|
2016-01-12 02:53:41 +11:00
|
|
|
|
2018-02-16 05:47:01 +11:00
|
|
|
from xbmc import getCondVisibility, sleep
|
2017-09-10 23:09:32 +10:00
|
|
|
from xbmcgui import Window
|
2016-01-12 02:53:41 +11:00
|
|
|
|
2018-02-16 05:47:01 +11:00
|
|
|
###############################################################################
|
|
|
|
|
2016-04-07 16:34:01 +10:00
|
|
|
|
2018-02-16 05:47:01 +11:00
|
|
|
def _get_kodi_type():
|
|
|
|
kodi_type = listitem.getVideoInfoTag().getMediaType().decode('utf-8')
|
|
|
|
if not kodi_type:
|
|
|
|
if getCondVisibility('Container.Content(albums)'):
|
|
|
|
kodi_type = "album"
|
|
|
|
elif getCondVisibility('Container.Content(artists)'):
|
|
|
|
kodi_type = "artist"
|
|
|
|
elif getCondVisibility('Container.Content(songs)'):
|
|
|
|
kodi_type = "song"
|
|
|
|
elif getCondVisibility('Container.Content(pictures)'):
|
|
|
|
kodi_type = "picture"
|
|
|
|
return kodi_type
|
2016-01-12 02:53:41 +11:00
|
|
|
|
2016-08-30 02:44:27 +10:00
|
|
|
|
2016-10-23 02:15:10 +11:00
|
|
|
if __name__ == "__main__":
|
2018-02-01 18:23:31 +11:00
|
|
|
WINDOW = Window(10000)
|
2018-02-16 05:47:01 +11:00
|
|
|
KODI_ID = listitem.getVideoInfoTag().getDbId()
|
|
|
|
KODI_TYPE = _get_kodi_type()
|
|
|
|
ARGS = {
|
|
|
|
'kodi_id': KODI_ID,
|
|
|
|
'kodi_type': KODI_TYPE
|
|
|
|
}
|
2018-02-01 18:23:31 +11:00
|
|
|
while WINDOW.getProperty('plex_command'):
|
2017-09-10 23:09:32 +10:00
|
|
|
sleep(20)
|
2018-02-16 05:47:01 +11:00
|
|
|
WINDOW.setProperty('plex_command', 'CONTEXT_menu?%s' % urlencode(ARGS))
|