forked from MediaBrowser/plugin.video.emby
-
-
Notifications
You must be signed in to change notification settings - Fork 89
Expand file tree
/
Copy pathcontext_watchlist_add.py
More file actions
28 lines (22 loc) · 709 Bytes
/
context_watchlist_add.py
File metadata and controls
28 lines (22 loc) · 709 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# -*- coding: utf-8 -*-
"""
Grabs kodi_id and kodi_type for the Kodi item the context menu was called for
and sends a request to our main Python instance
"""
from urllib.parse import urlencode
from xbmc import sleep
from xbmcgui import Window
from resources.lib.contextmenu.common import kodi_item_from_listitem
def main():
kodi_id, kodi_type = kodi_item_from_listitem()
args = {
'kodi_id': kodi_id,
'kodi_type': kodi_type
}
window = Window(10000)
while window.getProperty('plexkodiconnect.command'):
sleep(20)
window.setProperty('plexkodiconnect.command',
'WATCHLIST_ADD?%s' % urlencode(args))
if __name__ == "__main__":
main()