2015-03-13 21:24:59 +00:00
|
|
|
import xbmcaddon
|
|
|
|
import xbmcplugin
|
|
|
|
import xbmc
|
|
|
|
import xbmcgui
|
2015-05-03 15:39:12 +00:00
|
|
|
import xbmcvfs
|
2015-05-05 11:27:45 +00:00
|
|
|
import os, sys
|
|
|
|
|
2015-03-13 21:24:59 +00:00
|
|
|
|
2015-03-25 17:37:21 +00:00
|
|
|
addonSettings = xbmcaddon.Addon(id='plugin.video.emby')
|
2015-03-13 21:24:59 +00:00
|
|
|
cwd = addonSettings.getAddonInfo('path')
|
|
|
|
BASE_RESOURCE_PATH = xbmc.translatePath( os.path.join( cwd, 'resources', 'lib' ) )
|
|
|
|
sys.path.append(BASE_RESOURCE_PATH)
|
|
|
|
|
2015-05-03 15:39:12 +00:00
|
|
|
|
2015-03-13 21:24:59 +00:00
|
|
|
|
2015-05-05 20:18:52 +00:00
|
|
|
import Entrypoint as entrypoint
|
2015-03-13 21:24:59 +00:00
|
|
|
import Utils as utils
|
2015-05-05 11:27:45 +00:00
|
|
|
|
2015-03-13 21:24:59 +00:00
|
|
|
|
2015-04-02 19:47:06 +00:00
|
|
|
try:
|
2015-05-02 21:40:30 +00:00
|
|
|
params = utils.get_params(sys.argv[2])
|
|
|
|
mode = params['mode']
|
2015-05-04 21:42:21 +00:00
|
|
|
id = params.get('id', None)
|
2015-05-06 21:41:44 +00:00
|
|
|
name = params.get('name',None)
|
2015-04-02 19:47:06 +00:00
|
|
|
except:
|
2015-05-02 21:40:30 +00:00
|
|
|
params = {}
|
|
|
|
mode = None
|
|
|
|
|
2015-05-05 11:27:45 +00:00
|
|
|
##### Play items via plugin://plugin.video.emby/ #####
|
2015-05-08 17:05:10 +00:00
|
|
|
if mode == "play" or mode == "playnow":
|
2015-05-05 20:18:52 +00:00
|
|
|
entrypoint.doPlayback(id)
|
2015-05-08 17:05:10 +00:00
|
|
|
|
2015-05-05 11:27:45 +00:00
|
|
|
##### DO DATABASE RESET #####
|
2015-05-04 21:40:44 +00:00
|
|
|
elif mode == "reset":
|
|
|
|
utils.reset()
|
|
|
|
|
2015-05-05 11:27:45 +00:00
|
|
|
#### DO RESET AUTH #####
|
2015-05-05 00:03:46 +00:00
|
|
|
elif mode == "resetauth":
|
2015-05-05 20:18:52 +00:00
|
|
|
entrypoint.resetAuth()
|
2015-05-05 02:00:53 +00:00
|
|
|
|
2015-05-06 03:02:36 +00:00
|
|
|
elif mode == "adduser":
|
|
|
|
entrypoint.addUser()
|
2015-05-06 22:05:27 +00:00
|
|
|
|
|
|
|
elif mode == "settings":
|
|
|
|
xbmc.executebuiltin('Addon.OpenSettings(plugin.video.emby)')
|
2015-05-06 03:02:36 +00:00
|
|
|
|
2015-05-07 09:36:34 +00:00
|
|
|
elif mode == "manualsync":
|
|
|
|
from LibrarySync import LibrarySync
|
|
|
|
LibrarySync().FullLibrarySync(True)
|
2015-05-06 22:05:27 +00:00
|
|
|
|
2015-05-05 11:27:45 +00:00
|
|
|
##### BROWSE EMBY CHANNELS ROOT #####
|
|
|
|
elif mode == "channels":
|
2015-05-05 20:18:52 +00:00
|
|
|
entrypoint.BrowseChannels(id)
|
2015-05-04 23:43:46 +00:00
|
|
|
|
2015-05-05 11:27:45 +00:00
|
|
|
##### BROWSE EMBY CHANNELS FOLDER #####
|
|
|
|
elif mode == "channelsfolder":
|
|
|
|
folderid = params['folderid']
|
2015-05-05 20:18:52 +00:00
|
|
|
entrypoint.BrowseChannels(id,folderid)
|
2015-05-05 11:27:45 +00:00
|
|
|
|
|
|
|
##### GET NEXTUP EPISODES FOR TAGNAME #####
|
2015-05-04 23:43:46 +00:00
|
|
|
elif mode == "nextup":
|
|
|
|
limit = int(params['limit'])
|
2015-05-05 20:18:52 +00:00
|
|
|
entrypoint.getNextUpEpisodes(id, limit)
|
2015-05-04 22:24:41 +00:00
|
|
|
|
|
|
|
|
2015-05-05 11:27:45 +00:00
|
|
|
##### GET EXTRAFANART FOR LISTITEM #####
|
2015-05-03 15:39:12 +00:00
|
|
|
elif "extrafanart" in sys.argv[0]:
|
2015-05-05 20:18:52 +00:00
|
|
|
entrypoint.getExtraFanArt()
|
2015-05-03 15:39:12 +00:00
|
|
|
|
|
|
|
|
2015-05-06 22:05:27 +00:00
|
|
|
##### SHOW ADDON NODES LISTING #####
|
2015-05-05 02:53:21 +00:00
|
|
|
else:
|
2015-05-06 22:05:27 +00:00
|
|
|
entrypoint.doMainListing()
|
|
|
|
|
2015-03-13 21:24:59 +00:00
|
|
|
|