From 74179308ec9d90cfe4694170029fa40e88b045fc Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Sat, 15 Aug 2020 15:17:31 +0200 Subject: [PATCH] apply P number targeting fix to uploads --- WebHostLib/upload.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebHostLib/upload.py b/WebHostLib/upload.py index 91e4cc19..15236a2b 100644 --- a/WebHostLib/upload.py +++ b/WebHostLib/upload.py @@ -39,7 +39,7 @@ def uploads(): if file.filename.endswith(banned_zip_contents): return "Uploaded data contained a rom file, which is likely to contain copyrighted material. Your file was deleted." elif file.filename.endswith(".bmbp"): - player = int(file.filename.split("P")[-1].split(".")[0].split("_")[0]) + player = int(file.filename.split("P")[1].split(".")[0].split("_")[0]) patches.add(Patch(data=zfile.open(file, "r").read(), player=player)) elif file.filename.endswith(".txt"): spoiler = zfile.open(file, "rt").read().decode("utf-8-sig")