First go at updating category last updated date based on reply data
This commit is contained in:
parent
65c9a070ad
commit
4760777e07
19
data.py
19
data.py
|
@ -190,6 +190,25 @@ class LinkData:
|
|||
if cat_record["last_updated"] < timestamp:
|
||||
cat_record["last_updated"] = timestamp
|
||||
|
||||
for record in self.link_data:
|
||||
if record[4] == "":
|
||||
parent_id = self.get_parent_record(record[3])
|
||||
timestamp = record[2]
|
||||
if parent_id != -1:
|
||||
for line in self.link_data:
|
||||
if line[0] == parent_id:
|
||||
name = record[4]
|
||||
for cat_record in self.categories:
|
||||
if cat_record["name"] == name:
|
||||
if cat_record["last_updated"] < timestamp:
|
||||
cat_record["last_updated"] = timestamp
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def search(self, keyword: str) -> list:
|
||||
"""returns a unique list of link_data records for posts that contain
|
||||
the specified keyword"""
|
||||
|
|
Loading…
Reference in New Issue