mirror of https://gitlab.com/bashrc2/epicyon
Comments
parent
8ae7262e9a
commit
3a509400a7
2
utils.py
2
utils.py
|
@ -1334,12 +1334,14 @@ def _deleteHashtagsOnPost(baseDir: str, postJsonObject: {}) -> None:
|
|||
newlines = ''
|
||||
for fileLine in lines:
|
||||
if postId in fileLine:
|
||||
# skip over the deleted post
|
||||
continue
|
||||
newlines += fileLine
|
||||
if not newlines.strip():
|
||||
# if there are no lines then remove the hashtag file
|
||||
os.remove(tagIndexFilename)
|
||||
else:
|
||||
# write the new hashtag index without the given post in it
|
||||
with open(tagIndexFilename, "w+") as f:
|
||||
f.write(newlines)
|
||||
|
||||
|
|
Loading…
Reference in New Issue