Example #1
0
def Plugins(**kwargs):
	if OVLock() == False:
		return
	else:
		screenwidth = getDesktop(0).size().width()
		if screenwidth and screenwidth == 1920: iconFile = "icons/iptvlogohd.png"
		else: iconFile = "icons/iptvlogo.png"
		desc = _("Watch Videos Online")
		list = []
		if config.plugins.iptvplayer.plugin_autostart.value:
			if config.plugins.iptvplayer.plugin_autostart_method.value == 'wizard':
				list.append(PluginDescriptor(name=(("E2iPlayer")), description=desc, where = [PluginDescriptor.WHERE_WIZARD], fnc=(9, pluginAutostart), needsRestart=False))
			elif config.plugins.iptvplayer.plugin_autostart_method.value == 'infobar':
				list.append(PluginDescriptor(where=[PluginDescriptor.WHERE_SESSIONSTART, PluginDescriptor.WHERE_AUTOSTART], fnc=pluginAutostartSetup))

		list.append(PluginDescriptor(name=(("E2iPlayer")), description=desc, where = [PluginDescriptor.WHERE_PLUGINMENU], icon=iconFile, fnc=main)) # always show in plugin menu
		list.append(PluginDescriptor(name=(("E2iPlayer")), description=desc, where = PluginDescriptor.WHERE_MENU, fnc=startIPTVfromMenu))
		if config.plugins.iptvplayer.showinextensions.value:
			list.append (PluginDescriptor(name=(("E2iPlayer")), description=desc, where = [PluginDescriptor.WHERE_EXTENSIONSMENU], fnc=main))
		if  IsWebInterfaceModuleAvailable() and config.plugins.iptvplayer.IPTVWebIterface.value:
			try:
				list.append(PluginDescriptor(where=PluginDescriptor.WHERE_SESSIONSTART, fnc=sessionstart, needsRestart=False)) # activating IPTV web interface
			except Exception:
				print("IPTVplayer Exception appending PluginDescriptor.WHERE_SESSIONSTART descriptor.")
		return list
Example #2
0
def Plugins(**kwargs):
    screenwidth = getDesktop(0).size().width()
    if screenwidth and screenwidth == 1920: iconFile = "icons/iptvlogohd.png"
    else: iconFile = "icons/iptvlogo.png"
    desc = _("Watch video materials from IPTV services")
    list = []
    if config.plugins.iptvplayer.plugin_autostart.value:
        list.append(
            PluginDescriptor(name=(_("IPTV Player")),
                             description=desc,
                             where=[PluginDescriptor.WHERE_WIZARD],
                             fnc=(9, pluginAutostart),
                             needsRestart=False))
    list.append(
        PluginDescriptor(name=(_("IPTV Player")),
                         description=desc,
                         where=[PluginDescriptor.WHERE_PLUGINMENU],
                         icon=iconFile,
                         fnc=main))  # always show in plugin menu
    list.append(
        PluginDescriptor(name=(_("IPTV Player")),
                         description=desc,
                         where=PluginDescriptor.WHERE_MENU,
                         fnc=startIPTVfromMenu))
    if config.plugins.iptvplayer.showinextensions.value:
        list.append(
            PluginDescriptor(name=(_("IPTV Player")),
                             description=desc,
                             where=[PluginDescriptor.WHERE_EXTENSIONSMENU],
                             fnc=main))
    if IsWebInterfaceModuleAvailable(
    ) and config.plugins.iptvplayer.IPTVWebIterface.value:
        try:
            list.append(
                PluginDescriptor(
                    where=PluginDescriptor.WHERE_SESSIONSTART,
                    fnc=sessionstart,
                    needsRestart=False))  # activating IPTV web interface
        except Exception:
            print "IPTVplayer Exception appending PluginDescriptor.WHERE_SESSIONSTART descriptor."
    return list
Example #3
0
 def getMessageBeforeClose(self, afterSave):
     needPluginUpdate = False
     if afterSave and config.plugins.iptvplayer.ListaGraficzna.value and 0 == GetAvailableIconSize(False):
         needPluginUpdate = True
     else:
         enabledHostsList = GetEnabledHostsList()
         hostsFromFolder  = GetHostsList(fromList=False, fromHostFolder=True)
         if self.remove_diabled_hostsOld != config.plugins.iptvplayer.remove_diabled_hosts.value:
             if config.plugins.iptvplayer.remove_diabled_hosts.value:
                 for folderItem in hostsFromFolder:
                     if folderItem in enabledHostsList:
                         continue
                     else:
                         # there is host file which is not enabled, 
                         # so we need perform update to remove it
                         needPluginUpdate = True
                         break
             else:
                 hostsFromList = GetHostsList(fromList=True, fromHostFolder=False)
                 if not set(hostsFromList).issubset(set(hostsFromFolder)):
                     # there is missing hosts files, we need updated does not matter 
                     # if these hosts are enabled or disabled
                     needPluginUpdate = True
         elif IsUpdateNeededForHostsChangesCommit(self.enabledHostsListOld, enabledHostsList, hostsFromFolder):
             needPluginUpdate = True
     
     if needPluginUpdate:
         SetGraphicsHash("")
         SetIconsHash("")
     
     if not needPluginUpdate and config.plugins.iptvplayer.IPTVWebIterface.value != IsWebInterfaceModuleAvailable(True):
         needPluginUpdate = True
         
     if needPluginUpdate:
         return _('Some changes will be applied only after plugin update.\nDo you want to perform update now?')
     else:
         return ''