forked from indymedia/epicyon
Only show tags that exist
parent
d2f8d916f7
commit
f45f6235d0
21
utils.py
21
utils.py
|
@ -69,16 +69,17 @@ def getHashtagCategories(baseDir: str, recent=False, category=None) -> None:
|
||||||
|
|
||||||
if recent:
|
if recent:
|
||||||
tagsFilename = baseDir + '/tags/' + hashtag + '.txt'
|
tagsFilename = baseDir + '/tags/' + hashtag + '.txt'
|
||||||
if os.path.isfile(tagsFilename):
|
if not os.path.isfile(tagsFilename):
|
||||||
modTimesinceEpoc = \
|
continue
|
||||||
os.path.getmtime(tagsFilename)
|
modTimesinceEpoc = \
|
||||||
lastModifiedDate = \
|
os.path.getmtime(tagsFilename)
|
||||||
datetime.datetime.fromtimestamp(modTimesinceEpoc)
|
lastModifiedDate = \
|
||||||
fileDaysSinceEpoch = \
|
datetime.datetime.fromtimestamp(modTimesinceEpoc)
|
||||||
(lastModifiedDate -
|
fileDaysSinceEpoch = \
|
||||||
datetime.datetime(1970, 1, 1)).days
|
(lastModifiedDate -
|
||||||
if fileDaysSinceEpoch < recently:
|
datetime.datetime(1970, 1, 1)).days
|
||||||
continue
|
if fileDaysSinceEpoch < recently:
|
||||||
|
continue
|
||||||
|
|
||||||
if not hashtagCategories.get(categoryStr):
|
if not hashtagCategories.get(categoryStr):
|
||||||
hashtagCategories[categoryStr] = [hashtag]
|
hashtagCategories[categoryStr] = [hashtag]
|
||||||
|
|
Loading…
Reference in New Issue