Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: build m3u file if not DEV_MODE #1641

Merged
merged 2 commits into from
Feb 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading