Load peertube instances from file

merge-requests/8/head
Bob Mottram 2020-12-24 09:45:41 +00:00
parent cf4d9466eb
commit dadf850e5b
1 changed files with 8 additions and 1 deletions

View File

@ -13635,8 +13635,15 @@ def runDaemon(sendThreadsTimeoutMins: int,
httpd.iconsCache = {}
httpd.fontsCache = {}
# TODO load peertube instances
# load peertube instances from file into a list
httpd.peertubeInstances = []
peertubeInstancesFilename = baseDir + '/accounts/peertube.txt'
if os.path.isfile(peertubeInstancesFilename):
with open(peertubeInstancesFilename, 'r') as fp:
peertubeStr = fp.read()
if peertubeStr:
peertubeStr = peertubeStr.replace('\r', '')
httpd.peertubeInstances = peertubeStr.split('\n')
createInitialLastSeen(baseDir, httpPrefix)