From e34828bfd06922e36b577c714c3d22f4ac0ccd54 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 13 Oct 2020 21:19:23 +0100 Subject: [PATCH] Set instance type earlier --- daemon.py | 54 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/daemon.py b/daemon.py index 805f82b7..ed16307d 100644 --- a/daemon.py +++ b/daemon.py @@ -3328,6 +3328,34 @@ class PubServer(BaseHTTPRequestHandler): if fields['displayNickname'] != actorJson['name']: actorJson['name'] = fields['displayNickname'] actorChanged = True + + # change media instance status + if fields.get('mediaInstance'): + self.server.mediaInstance = False + self.server.defaultTimeline = 'inbox' + if fields['mediaInstance'] == 'on': + self.server.mediaInstance = True + self.server.blogsInstance = False + self.server.newsInstance = False + self.server.defaultTimeline = 'tlmedia' + setConfigParam(baseDir, + "mediaInstance", + self.server.mediaInstance) + setConfigParam(baseDir, + "blogsInstance", + self.server.blogsInstance) + setConfigParam(baseDir, + "newsInstance", + self.server.newsInstance) + else: + if self.server.mediaInstance: + self.server.mediaInstance = False + self.server.defaultTimeline = 'inbox' + setConfigParam(baseDir, + "mediaInstance", + self.server.mediaInstance) + + # change theme if fields.get('themeDropdown'): setTheme(baseDir, fields['themeDropdown'], @@ -3672,32 +3700,6 @@ class PubServer(BaseHTTPRequestHandler): if currTheme: setTheme(baseDir, currTheme, domain) - # change media instance status - if fields.get('mediaInstance'): - self.server.mediaInstance = False - self.server.defaultTimeline = 'inbox' - if fields['mediaInstance'] == 'on': - self.server.mediaInstance = True - self.server.blogsInstance = False - self.server.newsInstance = False - self.server.defaultTimeline = 'tlmedia' - setConfigParam(baseDir, - "mediaInstance", - self.server.mediaInstance) - setConfigParam(baseDir, - "blogsInstance", - self.server.blogsInstance) - setConfigParam(baseDir, - "newsInstance", - self.server.newsInstance) - else: - if self.server.mediaInstance: - self.server.mediaInstance = False - self.server.defaultTimeline = 'inbox' - setConfigParam(baseDir, - "mediaInstance", - self.server.mediaInstance) - # change news instance status if fields.get('newsInstance'): self.server.newsInstance = False