|
12 | 12 | from DumbTools import DumbPrefs |
13 | 13 |
|
14 | 14 | DEBUGMODE = True |
15 | | -TITLE = 'HDHR Viewer 2 (1.1.2)' |
| 15 | +TITLE = 'HDHR Viewer 2 (1.1.3)' |
16 | 16 | PREFIX = '/video/hdhrv2' |
17 | | -VERSION = '1.1.2' |
| 17 | +VERSION = '1.1.3' |
18 | 18 |
|
19 | 19 | #GRAPHICS |
20 | 20 | ART = 'art-default.jpg' |
|
38 | 38 | PREFS_VCODEC = 'videocodec' |
39 | 39 | PREFS_ACODEC = 'audiocodec' |
40 | 40 | PREFS_ICONDIR = 'icon_directory' |
| 41 | +PREFS_AUTODISCOVER = 'autodiscover' |
41 | 42 |
|
42 | 43 | #XMLTV Modes |
43 | 44 | XMLTV_MODE_RESTAPI = 'restapi' |
@@ -1387,28 +1388,29 @@ def __init__(self): |
1387 | 1388 | # Auto Discover devices |
1388 | 1389 | def autoDiscover(self): |
1389 | 1390 | cacheTime=None |
1390 | | - try: |
1391 | | - response = xstr(HTTP.Request(URL_HDHR_DISCOVER_DEVICES,timeout=TIMEOUT,cacheTime=cacheTime)) |
1392 | | - JSONdevices = JSON.ObjectFromString(''.join(response.splitlines())) |
1393 | | - |
1394 | | - for device in JSONdevices: |
1395 | | - StorageURL = device.get('StorageURL') |
1396 | | - LineupURL = device.get('LineupURL') |
1397 | | - |
1398 | | - if LineupURL is not None: |
1399 | | - if not xany(d['LocalIP']==device['LocalIP'] for d in self.tunerDevices): |
1400 | | - device['autoDiscover'] = True |
1401 | | - logInfo('Adding auto discovered tuner: '+device['LocalIP']) |
1402 | | - self.tunerDevices.append(device) |
1403 | | - else: |
1404 | | - logInfo('Auto discovered tuner skipped (duplicate): '+device['LocalIP']) |
1405 | | - |
1406 | | - #future |
1407 | | - if StorageURL is not None: |
1408 | | - self.storageServers.append(device) |
| 1391 | + if Prefs[PREFS_AUTODISCOVER]: |
| 1392 | + try: |
| 1393 | + response = xstr(HTTP.Request(URL_HDHR_DISCOVER_DEVICES,timeout=TIMEOUT,cacheTime=cacheTime)) |
| 1394 | + JSONdevices = JSON.ObjectFromString(''.join(response.splitlines())) |
| 1395 | + |
| 1396 | + for device in JSONdevices: |
| 1397 | + StorageURL = device.get('StorageURL') |
| 1398 | + LineupURL = device.get('LineupURL') |
| 1399 | + |
| 1400 | + if LineupURL is not None: |
| 1401 | + if not xany(d['LocalIP']==device['LocalIP'] for d in self.tunerDevices): |
| 1402 | + device['autoDiscover'] = True |
| 1403 | + logInfo('Adding auto discovered tuner: '+device['LocalIP']) |
| 1404 | + self.tunerDevices.append(device) |
| 1405 | + else: |
| 1406 | + logInfo('Auto discovered tuner skipped (duplicate): '+device['LocalIP']) |
1409 | 1407 |
|
1410 | | - except Exception as inst: |
1411 | | - logError('Devices.autoDiscover(): '+strError(inst)) |
| 1408 | + #future |
| 1409 | + if StorageURL is not None: |
| 1410 | + self.storageServers.append(device) |
| 1411 | + except Exception as inst: |
| 1412 | + logError('Devices.autoDiscover(): '+strError(inst)) |
| 1413 | + |
1412 | 1414 |
|
1413 | 1415 | # Get manual tuners listed in Settings |
1414 | 1416 | def manualTuner(self): |
|
0 commit comments