mirror of
https://github.com/ail-project/ail-framework.git
synced 2025-01-18 16:36:13 +00:00
Update abstract_chat_object.py
9a388dc9cb
broke the Forum view, we can not do stat on forum, only on subchan :)
This commit is contained in:
parent
237e7de27d
commit
11e75b80d4
1 changed files with 8 additions and 5 deletions
|
@ -228,11 +228,14 @@ class AbstractChatObject(AbstractSubtypeObject, ABC):
|
||||||
return stats
|
return stats
|
||||||
|
|
||||||
def get_message_years(self):
|
def get_message_years(self):
|
||||||
timestamp = datetime.utcfromtimestamp(float(self.get_timestamp_first_message()))
|
try:
|
||||||
year_start = int(timestamp.strftime('%Y'))
|
timestamp = datetime.utcfromtimestamp(float(self.get_timestamp_first_message()))
|
||||||
timestamp = datetime.utcfromtimestamp(float(self.get_timestamp_last_message()))
|
year_start = int(timestamp.strftime('%Y'))
|
||||||
year_end = int(timestamp.strftime('%Y'))
|
timestamp = datetime.utcfromtimestamp(float(self.get_timestamp_last_message()))
|
||||||
return list(range(year_start, year_end + 1))
|
year_end = int(timestamp.strftime('%Y'))
|
||||||
|
return list(range(year_start, year_end + 1))
|
||||||
|
except:
|
||||||
|
return []
|
||||||
|
|
||||||
def get_nb_year_messages(self, year):
|
def get_nb_year_messages(self, year):
|
||||||
nb_year = {}
|
nb_year = {}
|
||||||
|
|
Loading…
Add table
Reference in a new issue