Skip to content

Commit b51c577

Browse files
authored
fix(services/seafile): avoid defaulting list size to zero (#7221)
1 parent 3c2fedd commit b51c577

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

core/services/seafile/src/lister.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,11 @@ impl oio::PageList for SeafileLister {
5656
);
5757

5858
let entry = if info.type_field == "file" {
59-
let meta = Metadata::new(EntryMode::FILE)
60-
.with_last_modified(Timestamp::from_second(info.mtime)?)
61-
.with_content_length(info.size.unwrap_or(0));
59+
let mut meta = Metadata::new(EntryMode::FILE)
60+
.with_last_modified(Timestamp::from_second(info.mtime)?);
61+
if let Some(size) = info.size {
62+
meta.set_content_length(size);
63+
}
6264
Entry::new(&rel_path, meta)
6365
} else {
6466
let path = format!("{rel_path}/");

0 commit comments

Comments
 (0)