Strip ID
This commit is contained in:
@@ -130,17 +130,18 @@ def read_workshop(content_file: str) -> tuple:
|
|||||||
with open(content_file, "rt") as content:
|
with open(content_file, "rt") as content:
|
||||||
content_ids = content.readlines()
|
content_ids = content.readlines()
|
||||||
for content_id in content_ids:
|
for content_id in content_ids:
|
||||||
if content_id.strip() == "":
|
stripped_id = content_id.strip()
|
||||||
|
if stripped_id == "":
|
||||||
break
|
break
|
||||||
|
|
||||||
if not content_id.isnumeric():
|
if not stripped_id.isnumeric():
|
||||||
print(f"Error: Invalid content ID '{content_id}', all IDs should be numeric!")
|
print(f"Error: Invalid content ID '{stripped_id}', all IDs should be numeric!")
|
||||||
return (False, [])
|
return (False, [])
|
||||||
|
|
||||||
if content_id in SERVER_SETUP_CONTENT:
|
if stripped_id in SERVER_SETUP_CONTENT:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
out_content.append(content_id)
|
out_content.append(stripped_id)
|
||||||
|
|
||||||
print(f"Found {len(out_content)} content IDs")
|
print(f"Found {len(out_content)} content IDs")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user