Fixed .osu filename sanitation to match circleguard

This commit is contained in:
nise.moe 2024-02-16 06:17:52 +01:00
parent 7ad7bd9768
commit cae24f11e1

View File

@ -119,7 +119,9 @@ def process_replay():
replay = Replay(decoded_data, pure_lzma=True) replay = Replay(decoded_data, pure_lzma=True)
replay.mods = Mod(replay_request.mods) replay.mods = Mod(replay_request.mods)
beatmap_file = f'dbs/{cg_beatmap.artist} - {cg_beatmap.title} ({cg_beatmap.creator})[{cg_beatmap.version}].osu' filename = (f'{cg_beatmap.artist} - {cg_beatmap.title} ({cg_beatmap.creator})[{cg_beatmap.version}].osu'
.replace('/', ''))
beatmap_file = f'dbs/{filename}'
if not os.path.exists(beatmap_file): if not os.path.exists(beatmap_file):
print(f'Map not found @ {beatmap_file}', flush=True) print(f'Map not found @ {beatmap_file}', flush=True)
return 400, "Map not found" return 400, "Map not found"