feat(readarr): fetch Readarr root folders and expose them on the CLI

Adds the GetRootFolders event backed by GET /rootfolder, storing the result
on the Readarr root folders table, and surfaces it as
"managarr readarr list root-folders".

Root folders reuse the shared RootFolder model. Readarr omits the
unmappedFolders key that the other servarrs return, and the field is
optional, so it deserializes to None without changing the shared type.

Only the read path is included here. Adding and deleting root folders
mutate the library layout, so they are left for separate work.
This commit is contained in:
Dark-Alex-17 committed 2026-08-20 22:32:16 -06:00
1 parent ce8c51b02f
commit 29186ea03c
6 files changed
+236

No files matched your search

@@ -30,6 +30,7 @@ mod tests {
"metadata-profiles",
"quality-profiles",
"queued-events",
"root-folders",
"tags",
"tasks",
"updates"
@@ -242,6 +243,29 @@ mod tests {
assert_ok!(&result);
}
#[tokio::test]
async fn test_handle_list_root_folders_command() {
let mut mock_network = MockNetworkTrait::new();
mock_network
.expect_handle_network_event()
.with(eq::<NetworkEvent>(ReadarrEvent::GetRootFolders.into()))
.times(1)
.returning(|_| {
Ok(Serdeable::Readarr(ReadarrSerdeable::Value(
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::test_default()));
let list_root_folders_command = ReadarrListCommand::RootFolders;
let result =
ReadarrListCommandHandler::with(&app_arc, list_root_folders_command, &mut mock_network)
.handle()
.await;
assert_ok!(&result);
}
#[tokio::test]
async fn test_handle_list_tags_command() {
let mut mock_network = MockNetworkTrait::new();