diff --git a/backend/endpoints/rom.py b/backend/endpoints/rom.py index d910f2ce4..345f3145b 100644 --- a/backend/endpoints/rom.py +++ b/backend/endpoints/rom.py @@ -392,7 +392,12 @@ async def build_zip_in_memory() -> bytes: # Add M3U file m3u_encoded_content = "\n".join( - [f.full_path.replace(rom.full_path, ".hidden") for f in files] + [ + f.full_path.replace( + rom.full_path, ".hidden" if hidden_folder else "" + ) + for f in files + ] ).encode() m3u_filename = f"{rom.fs_name}.m3u" m3u_info = ZipInfo(filename=m3u_filename, date_time=now.timetuple()[:6]) @@ -439,7 +444,10 @@ async def create_zip_content(f: RomFile, base_path: str = LIBRARY_BASE_PATH): content_lines = [await create_zip_content(f, "/library-zip") for f in files] m3u_encoded_content = "\n".join( - [f.full_path.replace(rom.full_path, "") for f in files] + [ + f.full_path.replace(rom.full_path, ".hidden" if hidden_folder else "") + for f in files + ] ).encode() m3u_base64_content = b64encode(m3u_encoded_content).decode() m3u_line = ZipContentLine(