Skip to content

Commit

Permalink
Merge pull request #1641 from rommapp/fix/hidden_folder
Browse files Browse the repository at this point in the history
fix: build m3u file if not DEV_MODE
  • Loading branch information
zurdi15 authored Feb 21, 2025
2 parents ea4dccc + 5352a48 commit 316487d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions backend/endpoints/rom.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 316487d

Please sign in to comment.