From e1abfed010bcb138ed3a2190a250b75bc15fdc43 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 17 Nov 2019 17:59:27 +0000 Subject: [PATCH] Use announce cache --- posts.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/posts.py b/posts.py index 92b53969..807c91e2 100644 --- a/posts.py +++ b/posts.py @@ -2074,6 +2074,8 @@ def createBoxBase(session,baseDir: str,boxname: str, \ # extract DMs or replies or media from the inbox boxDir = createPersonDir(nickname,domain,baseDir,'inbox') + announceCacheDir=baseDir+'/cache/announce/'+nickname + sharedBoxDir=None if boxname=='inbox' or boxname=='tlreplies' or \ boxname=='tlmedia': @@ -2133,7 +2135,11 @@ def createBoxBase(session,baseDir: str,boxname: str, \ postFilename=indexFile.readline() if not postFilename: break - postsInBox[postsCtr]=os.path.join(boxDir, postFilename.replace('\n','')) + postFilename=postFilename.replace('\n','') + fullPostFilename=os.path.join(boxDir, postFilename) + if not os.path.isfile(fullPostFilename): + fullPostFilename=os.path.join(announceCacheDir, postFilename) + postsInBox[postsCtr]=fullPostFilename postsCtr+=1 lookedUpFromIndex=True else: