feat: multiple shared directories

Shares::scan_many merges several roots into one index, suffixing
duplicate root names so virtual paths cannot collide, and skipping
unreadable roots instead of failing. ClientSettings now takes
shared_directories: Vec<String>; config gains a shared_dirs list
(combined with the single shared_dir and --shared-dir, deduped), with an
explicitly empty value still disabling sharing and the
share-what-you-download default unchanged.
This commit is contained in:
michel
2026-07-20 20:47:23 +02:00
parent 8389d525e7
commit a605431a10
9 changed files with 277 additions and 117 deletions
+7 -4
View File
@@ -353,10 +353,13 @@ impl MainTui {
let shortcuts_line = format_shortcuts_styled(&shortcuts);
// Surface our own sharing status in the block title.
let title = format!(
"Shortcuts · Sharing: {}",
self.client.shared_directory().unwrap_or("off")
);
let shared = self.client.shared_directories();
let sharing = match shared {
[] => "off".to_string(),
[only] => only.clone(),
more => format!("{} folders", more.len()),
};
let title = format!("Shortcuts · Sharing: {sharing}");
let shortcuts_widget = Paragraph::new(shortcuts_line).block(
Block::default()
.borders(Borders::ALL)