Skip to content

Commit

Permalink
skip tuner types that are not present or have no channels.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Blackburn committed Jun 25, 2017
1 parent 5244a63 commit 832e1ba
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions PlexDVRAPI/src/plugin.py
Expand Up @@ -134,13 +134,18 @@ def populate(self, answer=None):
TunerCount[type] = 'TunerCount: %s\n' % str(self.discover[type]["TunerCount"])
Source[type] = 'Source: %s\n' % str(tunerfolders[type]).title()
NoOfChannels[type] = 'Channels: %s\n\n' % str(self.discover[type]['NumChannels'])
if self.discover[type]["TunerCount"] > 0 and self.discover[type]['NumChannels'] > 0 and type != "multi":
self.label.append(BaseURL[type]+FriendlyName[type]+Source[type]+TunerCount[type]+NoOfChannels[type])

print '[Plex DVR API] %s' % str(BaseURL[type]).replace('\n','')
print '[Plex DVR API] %s' % str(FriendlyName[type]).replace('\n','')
print '[Plex DVR API] %s' % str(Source[type]).replace('\n','')
print '[Plex DVR API] %s' % str(TunerCount[type]).replace('\n','')
print '[Plex DVR API] %s' % str(NoOfChannels[type]).replace('\n\n','\n')
print '[Plex DVR API] %s' % str(NoOfChannels[type]).replace('\n\n','')

if self.discover[type]["TunerCount"] > 0 and self.discover[type]['NumChannels'] > 0 and type != "multi":
self.label.append(BaseURL[type]+FriendlyName[type]+Source[type]+TunerCount[type]+NoOfChannels[type])
else:
print '[Plex DVR API] skipping tuner %s' % type
continue

if not path.exists('/www/%s/discover.json' % tunerfolders[type]) or getIP() == '0.0.0.0' or self.discover[type]["TunerCount"] < 2:
self["key_red"].hide()
Expand Down

0 comments on commit 832e1ba

Please sign in to comment.