mirror of
https://github.com/rommapp/romm.git
synced 2026-02-18 00:27:41 +01:00
add comments
This commit is contained in:
@@ -403,7 +403,7 @@ async def download_roms(
|
||||
for file in rom_files:
|
||||
content_lines.append(
|
||||
ZipContentLine(
|
||||
crc32=None,
|
||||
crc32=None, # The CRC hash stored for compressed files is for the uncompressed content
|
||||
size_bytes=file.file_size_bytes,
|
||||
encoded_location=quote(f"/library/{file.full_path}"),
|
||||
filename=file.full_path,
|
||||
@@ -637,7 +637,7 @@ async def get_rom_content(
|
||||
|
||||
content_lines = [
|
||||
ZipContentLine(
|
||||
crc32=None,
|
||||
crc32=None, # The CRC hash stored for compressed files is for the uncompressed content
|
||||
size_bytes=f.file_size_bytes,
|
||||
encoded_location=quote(f"/library/{f.full_path}"),
|
||||
filename=f.file_name_for_download(rom, hidden_folder),
|
||||
|
||||
@@ -229,25 +229,27 @@ async function bulkDownloadRoms({
|
||||
roms: SimpleRom[];
|
||||
filename?: string;
|
||||
}) {
|
||||
if (roms.length === 0) return;
|
||||
return new Promise<void>((resolve) => {
|
||||
if (roms.length === 0) return resolve();
|
||||
|
||||
const romIds = roms.map((rom) => rom.id);
|
||||
const romIds = roms.map((rom) => rom.id);
|
||||
|
||||
const queryParams = new URLSearchParams();
|
||||
queryParams.append("rom_ids", romIds.join(","));
|
||||
if (filename) queryParams.append("filename", filename);
|
||||
const queryParams = new URLSearchParams();
|
||||
queryParams.append("rom_ids", romIds.join(","));
|
||||
if (filename) queryParams.append("filename", filename);
|
||||
|
||||
const a = document.createElement("a");
|
||||
a.href = `/api/roms/download?${queryParams.toString()}`;
|
||||
a.style.display = "none";
|
||||
const a = document.createElement("a");
|
||||
a.href = `/api/roms/download?${queryParams.toString()}`;
|
||||
a.style.display = "none";
|
||||
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
|
||||
setTimeout(() => {
|
||||
document.body.removeChild(a);
|
||||
window.URL.revokeObjectURL(a.href);
|
||||
}, DOWNLOAD_CLEANUP_DELAY);
|
||||
setTimeout(() => {
|
||||
document.body.removeChild(a);
|
||||
resolve();
|
||||
}, DOWNLOAD_CLEANUP_DELAY);
|
||||
});
|
||||
}
|
||||
|
||||
export type UpdateRom = SimpleRom & {
|
||||
|
||||
Reference in New Issue
Block a user