Skip to content

Commit 437e25e

Browse files
committed
Make drive id for pdfs optional
1 parent 1e0dfb2 commit 437e25e

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

rfd-processor/src/context.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ impl PdfStorage for PdfStorageCtx {
273273
if let Some(location) = self.locations.get(0) {
274274
let req = File {
275275
copy_requires_writer_permission: Some(true),
276-
drive_id: Some(location.drive_id.to_string()),
276+
drive_id: location.drive_id.clone(),
277277
parents: Some(vec![location.folder_id.to_string()]),
278278
name: Some(filename.to_string()),
279279
mime_type: Some("application/pdf".to_string()),
@@ -320,7 +320,7 @@ impl PdfStorage for PdfStorageCtx {
320320

321321
#[derive(Debug)]
322322
pub struct PdfStorageLocation {
323-
pub drive_id: String,
323+
pub drive_id: Option<String>,
324324
pub folder_id: String,
325325
}
326326

rfd-processor/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ pub struct StaticStorageConfig {
7474

7575
#[derive(Debug, Deserialize, Serialize)]
7676
pub struct PdfStorageConfig {
77-
pub drive: String,
77+
pub drive: Option<String>,
7878
pub folder: String,
7979
}
8080

rfd-processor/src/updater/update_pdfs.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ impl RfdUpdateAction for UpdatePdfs {
9696
new: &mut PersistedRfd,
9797
mode: RfdUpdateMode,
9898
) -> Result<RfdUpdateActionResponse, RfdUpdateActionErr> {
99+
// TODO: This updater should not upload a new version if there were no material changes to
100+
// the RFD. This is slightly tricky as we need to consider the contents of the RFD itself
101+
// as well as any external documents that may become embedded in it. It would be great if
102+
// we could hash the generated PDF, but from past attempts PDFs generated via asciidoctor-pdf
103+
// are not deterministic across systems
104+
99105
let RfdUpdateActionContext { ctx, update, .. } = ctx;
100106

101107
// On each update a PDF is uploaded (possibly overwriting an existing file)

0 commit comments

Comments
 (0)