forked from MediaBrowser/plugin.video.emby
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.py
58 lines (40 loc) · 1.66 KB
/
default.py
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# -*- coding: utf-8 -*-
#################################################################################################
import logging
import os
import sys
import xbmc
import xbmcaddon
#################################################################################################
__addon__ = xbmcaddon.Addon(id='plugin.video.emby')
__base__ = xbmc.translatePath(os.path.join(__addon__.getAddonInfo('path'), 'resources', 'lib')).decode('utf-8')
__libraries__ = xbmc.translatePath(os.path.join(__addon__.getAddonInfo('path'), 'libraries')).decode('utf-8')
__pcache__ = xbmc.translatePath(os.path.join(__addon__.getAddonInfo('profile'), 'emby')).decode('utf-8')
__cache__ = xbmc.translatePath('special://temp/emby').decode('utf-8')
sys.path.insert(0, __cache__)
sys.path.insert(0, __pcache__)
sys.path.insert(0, __libraries__)
sys.path.append(__base__)
#################################################################################################
from helper import window
#Verify emby for kodi plugin is fully loaded, timeout after 30 seconds
EmbyOnline = False
for i in range(60):
if window('emby_online.bool'):
EmbyOnline = True
from entrypoint import Events
break
else:
xbmc.sleep(500)
if not EmbyOnline:
exit()
#################################################################################################
LOG = logging.getLogger("EMBY.default")
#################################################################################################
if __name__ == "__main__":
LOG.debug("--->[ default ]")
try:
Events()
except Exception as error:
LOG.exception(error)
LOG.info("---<[ default ]")