server: compressed QMDL is decompressed in a zip

This is perhaps a bit silly, but the current output of a compressed
QmdlReader is always decompressed, so when we export a ZIP, we're
basically un-gzipping the QMDL before zipping it.

However, this approach makes for simpler code and results in a uniform
set of files for the user, which I think is worth the slight amount of
wasted processing.
This commit is contained in:
Will Greenberg
2026-04-03 13:40:31 -07:00
parent 73e3c9a5c2
commit af4a9aeb95
+5 -5
View File
@@ -337,14 +337,14 @@ pub async fn get_zip(
// Add QMDL file
{
let extension = if compressed { "qmdl.gz" } else { "qmdl" };
let entry = ZipEntryBuilder::new(
format!("{qmdl_idx}.{extension}").into(),
format!("{qmdl_idx}.qmdl").into(),
Compression::Stored,
);
// FuturesAsyncWriteCompatExt::compat_write because async-zip's entrystream does
// not impl tokio's AsyncWrite, but only future's AsyncWrite. This can be removed
// once https://github.com/Majored/rs-async-zip/pull/160 is released.
// FuturesAsyncWriteCompatExt::compat_write because async-zip's
// entrystream does not impl tokio's AsyncWrite, but only
// future's AsyncWrite. This can be removed once
// https://github.com/Majored/rs-async-zip/pull/160 is released.
let mut entry_writer = zip.write_entry_stream(entry).await?.compat_write();
let qmdl_store = qmdl_store_lock.read().await;
let mut qmdl_reader = qmdl_store.open_entry_qmdl(entry_index).await?;