jellyfin-kodi/default.py

91 lines
2.2 KiB
Python
Raw Normal View History

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
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
import Entrypoint as entrypoint
2015-03-13 21:24:59 +00:00
import Utils as utils
2015-03-13 21:24:59 +00:00
try:
params = utils.get_params(sys.argv[2])
mode = params['mode']
2015-05-04 21:42:21 +00:00
id = params.get('id', None)
name = params.get('name',None)
except:
params = {}
mode = None
##### Play items via plugin://plugin.video.emby/ #####
if mode == "play" or mode == "playnow":
entrypoint.doPlayback(id)
##### DO DATABASE RESET #####
elif mode == "reset":
utils.reset()
#### DO RESET AUTH #####
2015-05-05 00:03:46 +00:00
elif mode == "resetauth":
entrypoint.resetAuth()
elif mode == "adduser":
entrypoint.addUser()
2015-06-06 11:05:14 +00:00
elif mode == "userprefs":
entrypoint.userPreferences()
elif mode == "settings":
xbmc.executebuiltin('Addon.OpenSettings(plugin.video.emby)')
2015-05-07 09:36:34 +00:00
elif mode == "manualsync":
from LibrarySync import LibrarySync
LibrarySync().FullLibrarySync(True)
elif mode == "texturecache":
from TextureCache import TextureCache
TextureCache().FullTextureCacheSync()
##### BROWSE EMBY CHANNELS ROOT #####
elif mode == "channels":
entrypoint.BrowseChannels(id)
##### BROWSE EMBY CHANNELS FOLDER #####
elif mode == "channelsfolder":
folderid = params['folderid']
entrypoint.BrowseChannels(id,folderid)
##### GET NEXTUP EPISODES FOR TAGNAME #####
elif mode == "nextup":
limit = int(params['limit'])
entrypoint.getNextUpEpisodes(id, limit)
2015-05-04 22:24:41 +00:00
##### GET INPROGRESS EPISODES FOR TAGNAME #####
elif mode == "inprogressepisodes":
limit = int(params['limit'])
entrypoint.getInProgressEpisodes(id, limit)
##### GET RECENT EPISODES FOR TAGNAME #####
elif mode == "recentepisodes":
limit = int(params['limit'])
entrypoint.getRecentEpisodes(id, limit)
2015-05-04 22:24:41 +00:00
##### GET EXTRAFANART FOR LISTITEM #####
2015-05-03 15:39:12 +00:00
elif "extrafanart" in sys.argv[0]:
entrypoint.getExtraFanArt()
2015-05-03 15:39:12 +00:00
##### SHOW ADDON NODES LISTING #####
if mode is None:
entrypoint.doMainListing()
2015-03-13 21:24:59 +00:00