mirror of
https://github.com/OMGeeky/gdriver2.git
synced 2026-02-23 15:38:32 +01:00
fix readdir (offset stuff)
This commit is contained in:
@@ -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)?;
|
||||
|
||||
@@ -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))]
|
||||
|
||||
Reference in New Issue
Block a user