fix(radarr): model the download status as a DownloadStatus enum

Radarr was the only tree still holding DownloadRecord.status as a bare
String and comparing it against literals. It now carries its own
DownloadStatus enum, shaped exactly like the Sonarr, Lidarr and Readarr
copies, and is guarded with from_json_or_default so an unrecognised
status degrades to Unknown instead of failing the whole queue fetch.

The row-style decorator and get_movie_status compare against the enum
variants. The status cell is never rendered in the Radarr tree, so no
snapshot changes; the CLI JSON output is unchanged for every real value
since the enum serializes to the same camelCase strings.
This commit is contained in:
Dark-Alex-17 committed 2026-09-17 15:46:49 -06:00
1 parent 25da032f02
commit 7b6d595397
8 files changed
+126 -29

No files matched your search

+3 -3
View File
@@ -1,7 +1,7 @@
use crate::app::App;
use crate::logos::RADARR_LOGO;
use crate::models::Route;
use crate::models::radarr_models::{DownloadRecord, Movie};
use crate::models::radarr_models::{DownloadRecord, DownloadStatus, Movie};
use crate::models::servarr_data::radarr::radarr_data::RadarrData;
use crate::models::servarr_models::{DiskSpace, RootFolder};
use crate::ui::DrawUi;
@@ -230,11 +230,11 @@ fn decorate_with_row_style<'a>(
.iter()
.find(|&download| download.movie_id == movie.id)
{
if download.status == "downloading" {
if download.status == DownloadStatus::Downloading {
return row.downloading();
}
if download.status == "completed" {
if download.status == DownloadStatus::Completed {
return row.awaiting_import();
}
}