From 208a953c6f8907bd5eec35fc9577bb474c41c9ec Mon Sep 17 00:00:00 2001 From: Brendan Howell Date: Fri, 4 Dec 2020 00:16:12 +0100 Subject: [PATCH] some fixes for masto-fedi timelines --- screenless/bureau/publicrelations/publicrelations.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/screenless/bureau/publicrelations/publicrelations.py b/screenless/bureau/publicrelations/publicrelations.py index 79d5f25..ca493c3 100644 --- a/screenless/bureau/publicrelations/publicrelations.py +++ b/screenless/bureau/publicrelations/publicrelations.py @@ -339,9 +339,11 @@ class PublicRelations(Bureau): im.thumbnail((self.smprint["width"], 576), PIL.Image.ANTIALIAS) prn.image(im, impl="bitImageColumn") - tw_shortcode = self.short_tweet_id(str(t["id"])) + shortcode = self.short_tweet_id(str(t["id"])) #prn.barcode("PRmad." + tw_shortcode, "CODE128", function_type="B") - prn.soft_barcode("code128", "PRmad." + tw_shortcode, module_width=0.16) + prn.soft_barcode("code128", "PRmad." + shortcode, module_width=0.16) + with self.dbenv.begin(db=self.tweetdb, write=True) as txn: + txn.put(shortcode.encode(), str(t.id).encode()) notifications = self.masto.notifications(since_id=self.last_mast_notif) if len(notifications) > 0: @@ -358,8 +360,6 @@ class PublicRelations(Bureau): prn.text(note["type"] + " " + str(note["created_at"]) + " from ") prn.textln(username + ":") prn.textln(str(note["status"])) - with self.dbenv.begin(db=self.tweetdb, write=True) as txn: - txn.put(shortcode.encode(), tweet_id.encode()) prn.ln(2) prn.cut()