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 = ''
|
newlines = ''
|
||||||
for fileLine in lines:
|
for fileLine in lines:
|
||||||
if postId in fileLine:
|
if postId in fileLine:
|
||||||
|
# skip over the deleted post
|
||||||
continue
|
continue
|
||||||
newlines += fileLine
|
newlines += fileLine
|
||||||
if not newlines.strip():
|
if not newlines.strip():
|
||||||
# if there are no lines then remove the hashtag file
|
# if there are no lines then remove the hashtag file
|
||||||
os.remove(tagIndexFilename)
|
os.remove(tagIndexFilename)
|
||||||
else:
|
else:
|
||||||
|
# write the new hashtag index without the given post in it
|
||||||
with open(tagIndexFilename, "w+") as f:
|
with open(tagIndexFilename, "w+") as f:
|
||||||
f.write(newlines)
|
f.write(newlines)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue