From 16f4e7a312df3fd35dc7cc1236490049adeb88dc Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 28 Nov 2020 13:04:30 +0000 Subject: [PATCH] Constructing the features timeline --- posts.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/posts.py b/posts.py index 3384a5645..55dcaa912 100644 --- a/posts.py +++ b/posts.py @@ -2598,7 +2598,7 @@ def createBlogsTimeline(session, baseDir: str, nickname: str, domain: str, def createFeaturesTimeline(session, baseDir: str, nickname: str, domain: str, port: int, httpPrefix: str, itemsPerPage: int, headerOnly: bool, pageNumber=None) -> {}: - return createBoxIndexed({}, session, baseDir, 'tlfeatures', 'news', + return createBoxIndexed({}, session, baseDir, 'tlfeatures', nickname, domain, port, httpPrefix, itemsPerPage, headerOnly, True, 0, False, 0, pageNumber) @@ -2946,12 +2946,14 @@ def createBoxIndexed(recentPostsCache: {}, # bookmarks and events timelines are like the inbox # but have their own separate index indexBoxName = boxname + timelineNickname = nickname if boxname == "tlbookmarks": boxname = "bookmarks" indexBoxName = boxname elif boxname == "tlfeatures": boxname = "tlblogs" indexBoxName = boxname + timelineNickname = 'news' if port: if port != 80 and port != 443: @@ -2989,7 +2991,7 @@ def createBoxIndexed(recentPostsCache: {}, postsInBox = [] indexFilename = \ - baseDir + '/accounts/' + nickname + '@' + domain + \ + baseDir + '/accounts/' + timelineNickname + '@' + domain + \ '/' + indexBoxName + '.index' postsCtr = 0 if os.path.isfile(indexFilename): @@ -3074,7 +3076,18 @@ def createBoxIndexed(recentPostsCache: {}, addPostToTimeline(fullPostFilename, boxname, postsInBox, boxActor) else: - print('WARN: unable to locate post ' + postUrl) + # if this is the features timeline + if timelineNickname != nickname: + fullPostFilename = \ + locatePost(baseDir, timelineNickname, + domain, postUrl, False) + if fullPostFilename: + addPostToTimeline(fullPostFilename, boxname, + postsInBox, boxActor) + else: + print('WARN: unable to locate post ' + postUrl) + else: + print('WARN: unable to locate post ' + postUrl) postsCtr += 1