fix readdir (offset stuff)

This commit is contained in:
OMGeeky
2024-04-16 19:25:00 +02:00
parent 89c0123f3c
commit 8664f42c12
4 changed files with 32 additions and 22 deletions

View File

@@ -109,6 +109,7 @@ impl Drive {
todo!("Do something when a file is removed from drive");
return Ok(());
}
//TODO: deal with locally and remotely changed files
let mut original_meta = original_meta?;
self.process_parents_changes(parents, &id, &new_meta)?;
Self::process_meta_changes(new_meta, &mut original_meta)?;

View File

@@ -117,13 +117,15 @@ impl GDriverService for GdriverServer {
offset: usize,
) -> StdResult<Vec<ReadDirResult>, GetFileListError> {
let drive = self.drive.lock().await;
info!("Listing files in dir");
info!("Listing files in dir for id {id} with offset {offset}");
let children = drive
.path_resolver
.get_children(&id)
.map_err(|_| GetFileListError::NotFound)?
.clone();
Ok(children.into_iter().skip(offset).collect())
let children: Vec<_> = children.into_iter().skip(offset).collect();
info!("Found {} children", children.len());
Ok(children)
}
#[instrument(skip(self, context))]