forked from tildeverse/tilde.chat
fix null modes error
This commit is contained in:
parent
5ca47ce551
commit
700a5955e7
|
@ -38,10 +38,12 @@ out["channels"] = []
|
|||
for c in root.findall("./channellist/channel"):
|
||||
name = unsanitize(c.find("channelname"))
|
||||
|
||||
modes = c.find("./channelmodes").text
|
||||
if (
|
||||
# skip channels in the blacklist or with mode +s
|
||||
"s" in c.find("./channelmodes").text.split()[0]
|
||||
or name in BLACKLIST
|
||||
name in BLACKLIST
|
||||
or modes is None
|
||||
or "s" in modes.split()[0]
|
||||
):
|
||||
continue
|
||||
|
||||
|
@ -54,7 +56,6 @@ for c in root.findall("./channellist/channel"):
|
|||
)
|
||||
)
|
||||
|
||||
|
||||
out["channels"].sort(key=lambda x: x["name"].lower())
|
||||
|
||||
with open(f"{WORK_DIR}/stats.json", "w") as f:
|
||||
|
|
Loading…
Reference in New Issue