From a730aa8450c9fceb2eb4a809ac3b48a4638a9039 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 15 Mar 2021 11:30:41 +0000 Subject: [PATCH] Stored message subdirectories --- notifications_client.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/notifications_client.py b/notifications_client.py index 68821379f..b6e5107bb 100644 --- a/notifications_client.py +++ b/notifications_client.py @@ -302,7 +302,13 @@ def _readLocalBoxPost(boxName: str, index: int, if len(indexList) <= index: return - speakerJsonFilename = os.path.join(msgDir, indexList[index]) + publishedYear = indexList[index].split('-')[0] + publishedMonth = indexList[index].split('-')[1] + speakerJsonFilename = \ + os.path.join(msgDir, + publishedYear + '/' + + publishedMonth + '/' + + indexList[index]) speakerJson = loadJson(speakerJsonFilename) nameStr = speakerJson['name'] @@ -369,7 +375,12 @@ def _showLocalBox(boxName: str, for pos in range(startPostIndex, startPostIndex + noOfPosts): if pos >= maxPostIndex: break - speakerJsonFilename = os.path.join(msgDir, index[pos]) + publishedYear = index[pos].split('-')[0] + publishedMonth = index[pos].split('-')[1] + speakerJsonFilename = \ + os.path.join(msgDir, + publishedYear + '/' + + publishedMonth + '/' + index[pos]) speakerJson = loadJson(speakerJsonFilename) if not speakerJson.get('published'): continue