def TunerInfo(type=None): if type: discover = getdeviceinfo.discoverdata(type) nochl = getlineup.noofchannels( type, config.hrtunerproxy.bouquets_list[type].value) BaseURL[type] = 'BaseURL: %s\n' % str(discover["BaseURL"]) FriendlyName[type] = 'FriendlyName: %s\n' % str( discover["FriendlyName"]) TunerCount[type] = 'TunerCount: %s\n' % str( getdeviceinfo.tunercount( type)) if type != 'iptv' else 'TunerCount: %s\n' % str( config.hrtunerproxy.iptv_tunercount.value) Source[type] = 'Source: %s\n' % str(tunerfolders[type]).title( ) if type != 'iptv' else 'Source: %s\n' % str( tunerfolders[type]).upper() NoOfChannels[type] = 'Channels: %s\n\n' % str(nochl) else: global choicelist choicelist = [] for type in tunerTypes: discover = getdeviceinfo.discoverdata(type) nochl = getlineup.noofchannels(type, 'all') BaseURL[type] = 'BaseURL: %s\n' % str(discover["BaseURL"]) FriendlyName[type] = 'FriendlyName: %s\n' % str( discover["FriendlyName"]) TunerCount[type] = 'TunerCount: %s\n' % str( getdeviceinfo.tunercount( type)) if type != 'iptv' else 'TunerCount: %s\n' % str( config.hrtunerproxy.iptv_tunercount.value) Source[type] = 'Source: %s\n' % str(tunerfolders[type]).title( ) if type != 'iptv' else 'Source: %s\n' % str( tunerfolders[type]).upper() NoOfChannels[type] = 'Channels: %s\n\n' % str(nochl)
def TunerInfo(): for type in tunerTypes: if path.exists('/www/%s/lineup_status.json' % tunerfolders[type]): remove('/www/%s/lineup_status.json' % tunerfolders[type]) if path.exists('/www/%s/lineup.json' % tunerfolders[type]): remove('/www/%s/lineup.json' % tunerfolders[type]) if path.exists('/www/%s/discover.json' % tunerfolders[type]): rename('/www/%s/discover.json' % tunerfolders[type], '/etc/enigma2/%s.discover' % type) if path.exists('/www/%s/device.xml' % tunerfolders[type]): rename('/www/%s/device.xml' % tunerfolders[type], '/etc/enigma2/%s.device' % type) if path.exists('/www/%s' % tunerfolders[type]) and not listdir( '/www/%s' % tunerfolders[type]): rmdir('/www/%s' % tunerfolders[type]) discover = getdeviceinfo.discoverdata(type) BaseURL[type] = 'BaseURL: %s\n' % str(discover["BaseURL"]) FriendlyName[type] = 'FriendlyName: %s\n' % str( discover["FriendlyName"]) TunerCount[type] = 'TunerCount: %s\n' % str( getdeviceinfo.tunercount(type)) Source[type] = 'Source: %s\n' % str(tunerfolders[type]).title() NoOfChannels[type] = 'Channels: %s\n\n' % str( getlineup.noofchannels(type)) if getdeviceinfo.tunercount(type) > 0 and getlineup.noofchannels( type) > 0: choicelist.append((type, str(tunerfolders[type]).title()))
getdeviceinfo.tunercount( type)) if type != 'iptv' else 'TunerCount: %s\n' % str( config.hrtunerproxy.iptv_tunercount.value) Source[type] = 'Source: %s\n' % str(tunerfolders[type]).title( ) if type != 'iptv' else 'Source: %s\n' % str( tunerfolders[type]).upper() NoOfChannels[type] = 'Channels: %s\n\n' % str(nochl) if config.hrtunerproxy.debug.value: TunerInfo() TunerInfoDebug() for type in tunerTypes: discover = getdeviceinfo.discoverdata(type) if getdeviceinfo.tunercount(type) > 0: choicelist.append((type, str(tunerfolders[type]).title())) config.hrtunerproxy.type = ConfigSelection(choices=choicelist) if config.hrtunerproxy.debug.value: logger.info('Using Tuner: %s' % str(config.hrtunerproxy.type.value)) tunerTypes = [] for type in config.hrtunerproxy.type.choices.choices: tunerTypes.append(type[0]) class HRTunerProxy_Setup(ConfigListScreen, Screen): if isDreamOS: # check if DreamOS image skin = "%s/skins/dreamos_main.xml" % (path.dirname( modules[__name__].__file__))
def populate(self, answer=None): setup_exists = False self["actions"].setEnabled(False) self["key_red"].hide() self["key_green"].hide() self["key_yellow"].hide() self["key_blue"].hide() if getIP() == '0.0.0.0': self["HintLabel"].hide() self["TunerInfoLabel"].setText( _('No IP address found, please make sure you are connected to your LAN via ethernet, wifi is not supported at this time.\n\nPress OK to close' )) self["closeaction"].setEnabled(True) elif self["config"].getCurrent() is not None: type = config.plexdvrapi.type.value currentconfig = self["config"].getCurrent()[0] TunerInfo() self.label = (BaseURL[type] + FriendlyName[type] + Source[type] + TunerCount[type] + NoOfChannels[type]) for types in tunerTypes: if path.exists('/etc/enigma2/%s.discover' % types): setup_exists = True if not path.exists('/etc/enigma2/%s.discover' % type): if getdeviceinfo.tunercount(type) < 2: self["TunerInfoLabel"].setText( _('WARNING: It seems you have a single tuner box, if the box is not left in Standby your Plex recordings WILL fail.' )) self["HintLabel"].setText( _('Press OK to continue setting up this tuner.')) self.hinttext = _( 'Press GREEN button to save your configuration files.') self["okaction"].setEnabled(True) self["key_green"].setText(_("Save")) self["key_yellow"].setText("") else: if not setup_exists: self["TunerInfoLabel"].setText( _('Please note: To use the DVR feature in Plex, you need to be a Plex Pass user. For more information about Plex Pass see https://www.plex.tv/features/plex-pass' )) else: self["TunerInfoLabel"].setText( _('Please note: To use a 2nd tuner type you need to setup/have a 2nd Plex Server, are you sure you want to continue?' )) if currentconfig == _('Tuner type to use.'): self["HintLabel"].setText( _('Press OK to continue setting up this tuner or press LEFT / RIGHT to select a different tuner type.' )) self.hinttext = _( 'Press LEFT / RIGHT to select a different tuner type.' ) else: self["HintLabel"].setText( _('Press OK to continue setting up this tuner or select a different tuner type.' )) self.hinttext = _( 'Press LEFT / RIGHT to select a different bouquet.' ) self.hinttext = self.hinttext + '\n' + _( 'Press GREEN button to save your configuration.') self["okaction"].setEnabled(True) self["key_green"].setText(_("Save")) self["key_yellow"].setText("") else: if currentconfig == _('Tuner type to use.'): self.hinttext = _( 'Press LEFT / RIGHT to select a different tuner type.') else: self.hinttext = _( 'Press LEFT / RIGHT to select a different bouquet.') self.hinttext = self.hinttext + '\n' + _( 'Press GREEN button to save your configuration.') self["key_green"].setText(_("Save")) self["key_yellow"].setText(_("Delete")) self.ok()