From af7b6f20a0347db74afbf1b26548f739c6d3d715 Mon Sep 17 00:00:00 2001 From: afterlifepro Date: Fri, 17 Oct 2025 22:24:20 +0100 Subject: [PATCH] upload: convert the file path to an rkey properly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit note: i still havent tested anything since upload blobs. and since upload blobs is most of the buisness logic lmao once jacquard is patched 🙏🙏 --- upload/src/main.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/upload/src/main.rs b/upload/src/main.rs index 975f010..91a9068 100644 --- a/upload/src/main.rs +++ b/upload/src/main.rs @@ -2,12 +2,11 @@ use clap::{ArgAction, Parser}; use jacquard::api::com_atproto::repo::apply_writes::{ self, ApplyWrites, ApplyWritesOutput, ApplyWritesWritesItem, }; +use jacquard::client::AgentSessionExt; use jacquard::client::MemorySessionStore; -use jacquard::client::{AgentSessionExt}; use jacquard::oauth::loopback::LoopbackConfig; use jacquard::oauth::types::AuthorizeOptions; use jacquard::types::string::{AtStrError, RecordKey, Rkey}; -use jacquard::{atproto, oauth}; use jacquard::{ Data, api::com_atproto::{self, repo::list_records::ListRecords}, @@ -17,7 +16,8 @@ use jacquard::{ types::{ident::AtIdentifier, nsid::Nsid, string::AtprotoStr, uri::Uri}, xrpc::XrpcExt, }; -use miette::{IntoDiagnostic, Result}; +use jacquard::{atproto, oauth}; +use miette::{Context, IntoDiagnostic, Result}; use std::{collections::HashMap, fs, path::PathBuf}; use crate::sitemap::{BlobRef, Sitemap, SitemapNode}; @@ -173,7 +173,9 @@ async fn update_remote_site( let mut create_records = new_sitemap .into_iter() .map(|(k, v)| { - let rkey = RecordKey(Rkey::new_owned(k).into_diagnostic()?); + let rkey = + utils::url_to_rkey(k).wrap_err("Invalid file path. Could not be converted to rkey")?; + let rkey = RecordKey(Rkey::new_owned(rkey).into_diagnostic()?); let blob = match v.blob { BlobRef::Local(_) => panic!("Illegal local blob"), BlobRef::Remote(cid) => cid, -- 2.51.2