You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by xu...@apache.org on 2026/02/23 13:38:54 UTC

(opendal) branch xuanwo/seafile-list-content-length created (now 8451bcc23)

This is an automated email from the ASF dual-hosted git repository.

xuanwo pushed a change to branch xuanwo/seafile-list-content-length
in repository https://gitbox.apache.org/repos/asf/opendal.git


      at 8451bcc23 fix(services/seafile): avoid defaulting list size to zero

This branch includes the following new commits:

     new 8451bcc23 fix(services/seafile): avoid defaulting list size to zero

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(opendal) 01/01: fix(services/seafile): avoid defaulting list size to zero

Posted by xu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xuanwo pushed a commit to branch xuanwo/seafile-list-content-length
in repository https://gitbox.apache.org/repos/asf/opendal.git

commit 8451bcc231c8eea0a48d26cc4dfbd59a59143e71
Author: Xuanwo <gi...@xuanwo.io>
AuthorDate: Mon Feb 23 21:38:38 2026 +0800

    fix(services/seafile): avoid defaulting list size to zero
---
 core/services/seafile/src/lister.rs | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/core/services/seafile/src/lister.rs b/core/services/seafile/src/lister.rs
index 6f97ce176..ccacd18e7 100644
--- a/core/services/seafile/src/lister.rs
+++ b/core/services/seafile/src/lister.rs
@@ -56,9 +56,11 @@ impl oio::PageList for SeafileLister {
                         );
 
                         let entry = if info.type_field == "file" {
-                            let meta = Metadata::new(EntryMode::FILE)
-                                .with_last_modified(Timestamp::from_second(info.mtime)?)
-                                .with_content_length(info.size.unwrap_or(0));
+                            let mut meta = Metadata::new(EntryMode::FILE)
+                                .with_last_modified(Timestamp::from_second(info.mtime)?);
+                            if let Some(size) = info.size {
+                                meta.set_content_length(size);
+                            }
                             Entry::new(&rel_path, meta)
                         } else {
                             let path = format!("{rel_path}/");