mirror of https://gitlab.com/bashrc2/epicyon
Tidying
parent
f40739e986
commit
670bbd2984
|
@ -136,6 +136,7 @@ from webapp_timeline import htmlInboxBlogs
|
||||||
from webapp_timeline import htmlInboxNews
|
from webapp_timeline import htmlInboxNews
|
||||||
from webapp_timeline import htmlInboxFeatures
|
from webapp_timeline import htmlInboxFeatures
|
||||||
from webapp_timeline import htmlOutbox
|
from webapp_timeline import htmlOutbox
|
||||||
|
from webapp_media import loadPeertubeInstances
|
||||||
from webapp_moderation import htmlAccountInfo
|
from webapp_moderation import htmlAccountInfo
|
||||||
from webapp_moderation import htmlModeration
|
from webapp_moderation import htmlModeration
|
||||||
from webapp_moderation import htmlModerationInfo
|
from webapp_moderation import htmlModerationInfo
|
||||||
|
@ -13637,13 +13638,7 @@ def runDaemon(sendThreadsTimeoutMins: int,
|
||||||
|
|
||||||
# load peertube instances from file into a list
|
# load peertube instances from file into a list
|
||||||
httpd.peertubeInstances = []
|
httpd.peertubeInstances = []
|
||||||
peertubeInstancesFilename = baseDir + '/accounts/peertube.txt'
|
loadPeertubeInstances(baseDir, httpd.peertubeInstances)
|
||||||
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)
|
createInitialLastSeen(baseDir, httpPrefix)
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,26 @@ __maintainer__ = "Bob Mottram"
|
||||||
__email__ = "bob@freedombone.net"
|
__email__ = "bob@freedombone.net"
|
||||||
__status__ = "Production"
|
__status__ = "Production"
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
|
||||||
|
def loadPeertubeInstances(baseDir: str, peertubeInstances: []) -> None:
|
||||||
|
"""Loads peertube instances from file into the given list
|
||||||
|
"""
|
||||||
|
peertubeList = None
|
||||||
|
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', '')
|
||||||
|
peertubeList = peertubeStr.split('\n')
|
||||||
|
if peertubeList:
|
||||||
|
for url in peertubeList:
|
||||||
|
if url in peertubeInstances:
|
||||||
|
continue
|
||||||
|
peertubeInstances.append(url)
|
||||||
|
|
||||||
|
|
||||||
def _addEmbeddedVideoFromSites(translate: {}, content: str,
|
def _addEmbeddedVideoFromSites(translate: {}, content: str,
|
||||||
peertubeInstances: [],
|
peertubeInstances: [],
|
||||||
|
|
Loading…
Reference in New Issue