Call reduce.reduce_tweet and session.save_users when retrieving previous items for a buffer

This commit is contained in:
Manuel Cortez 2021-06-27 18:07:56 -05:00
parent 1b9062d86f
commit 8db14a95c1

View File

@ -19,7 +19,7 @@ import languageHandler
import logging import logging
from audio_services import youtube_utils from audio_services import youtube_utils
from controller.buffers import baseBuffers from controller.buffers import baseBuffers
from sessions.twitter import compose, utils from sessions.twitter import compose, utils, reduce
from mysc.thread_utils import call_threaded from mysc.thread_utils import call_threaded
from tweepy.error import TweepError from tweepy.error import TweepError
from tweepy.cursor import Cursor from tweepy.cursor import Cursor
@ -231,8 +231,10 @@ class baseBufferController(baseBuffers.buffer):
if items == None: if items == None:
return return
items_db = self.session.db[self.name] items_db = self.session.db[self.name]
self.session.add_users_from_results(items)
for i in items: for i in items:
if utils.is_allowed(i, self.session.settings, self.name) == True and utils.find_item(i.id, self.session.db[self.name]) == None: if utils.is_allowed(i, self.session.settings, self.name) == True and utils.find_item(i.id, self.session.db[self.name]) == None:
i = reduce.reduce_tweet(i)
i = self.session.check_quoted_status(i) i = self.session.check_quoted_status(i)
i = self.session.check_long_tweet(i) i = self.session.check_long_tweet(i)
elements.append(i) elements.append(i)