Fixed some breaking changes with the most recent Radarr version. A few API fields were changed with either new names, or were omitted from some responses entirely and they were not documented by the Radarr team making them difficult to track down.
This commit is contained in:
@@ -5,7 +5,9 @@ mod tests {
|
||||
use crate::event::Key;
|
||||
use crate::handlers::radarr_handlers::blocklist::{blocklist_sorting_options, BlocklistHandler};
|
||||
use crate::handlers::KeyEventHandler;
|
||||
use crate::models::radarr_models::{BlocklistItem, Language, Movie, Quality, QualityWrapper};
|
||||
use crate::models::radarr_models::{
|
||||
BlocklistItem, BlocklistItemMovie, Language, Quality, QualityWrapper,
|
||||
};
|
||||
use crate::models::servarr_data::radarr::radarr_data::{ActiveRadarrBlock, BLOCKLIST_BLOCKS};
|
||||
use crate::models::stateful_table::SortOption;
|
||||
use chrono::DateTime;
|
||||
@@ -627,9 +629,8 @@ mod tests {
|
||||
name: "nikki".to_owned(),
|
||||
}]),
|
||||
date: DateTime::from(DateTime::parse_from_rfc3339("2024-01-10T07:28:45Z").unwrap()),
|
||||
movie: Movie {
|
||||
movie: BlocklistItemMovie {
|
||||
title: "test 3".into(),
|
||||
..Movie::default()
|
||||
},
|
||||
..BlocklistItem::default()
|
||||
},
|
||||
@@ -653,9 +654,8 @@ mod tests {
|
||||
},
|
||||
]),
|
||||
date: DateTime::from(DateTime::parse_from_rfc3339("2024-02-10T07:28:45Z").unwrap()),
|
||||
movie: Movie {
|
||||
movie: BlocklistItemMovie {
|
||||
title: "test 2".into(),
|
||||
..Movie::default()
|
||||
},
|
||||
..BlocklistItem::default()
|
||||
},
|
||||
@@ -674,9 +674,8 @@ mod tests {
|
||||
name: "English".to_owned(),
|
||||
}]),
|
||||
date: DateTime::from(DateTime::parse_from_rfc3339("2024-03-10T07:28:45Z").unwrap()),
|
||||
movie: Movie {
|
||||
movie: BlocklistItemMovie {
|
||||
title: "test 1".into(),
|
||||
..Movie::default()
|
||||
},
|
||||
..BlocklistItem::default()
|
||||
},
|
||||
|
||||
@@ -74,7 +74,12 @@ pub struct BlocklistItem {
|
||||
pub protocol: String,
|
||||
pub indexer: String,
|
||||
pub message: String,
|
||||
pub movie: Movie,
|
||||
pub movie: BlocklistItemMovie,
|
||||
}
|
||||
|
||||
#[derive(Default, Deserialize, Debug, Clone, PartialEq, Eq)]
|
||||
pub struct BlocklistItemMovie {
|
||||
pub title: HorizontallyScrollableText,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Derivative, Default, Clone, Debug, PartialEq, Eq)]
|
||||
@@ -342,8 +347,7 @@ impl Monitor {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Derivative, Deserialize, Debug, Clone, PartialEq, Eq)]
|
||||
#[derivative(Default)]
|
||||
#[derive(Derivative, Deserialize, Debug, Default, Clone, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Movie {
|
||||
#[serde(deserialize_with = "super::from_i64")]
|
||||
@@ -372,7 +376,13 @@ pub struct Movie {
|
||||
pub tags: Vec<Number>,
|
||||
pub ratings: RatingsList,
|
||||
pub movie_file: Option<MovieFile>,
|
||||
pub collection: Option<Collection>,
|
||||
pub collection: Option<MovieCollection>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Default, Debug, Clone, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct MovieCollection {
|
||||
pub title: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Default, Serialize, Debug)]
|
||||
@@ -382,8 +392,7 @@ pub struct MovieCommandBody {
|
||||
pub movie_ids: Vec<i64>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Derivative, Debug, Clone, PartialEq, Eq)]
|
||||
#[derivative(Default)]
|
||||
#[derive(Deserialize, Default, Debug, Clone, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct MovieFile {
|
||||
pub relative_path: String,
|
||||
|
||||
@@ -1195,7 +1195,11 @@ impl<'a, 'b> Network<'a, 'b> {
|
||||
Studio: {studio}
|
||||
Genres: {}",
|
||||
certification.unwrap_or_default(),
|
||||
collection.title,
|
||||
collection
|
||||
.title
|
||||
.as_ref()
|
||||
.unwrap_or(&String::new())
|
||||
.to_owned(),
|
||||
genres.join(", ")
|
||||
)),
|
||||
..MovieDetailsModal::default()
|
||||
|
||||
@@ -13,8 +13,9 @@ mod test {
|
||||
use tokio_util::sync::CancellationToken;
|
||||
|
||||
use crate::models::radarr_models::{
|
||||
BlocklistItem, CollectionMovie, IndexerField, Language, MediaInfo, MinimumAvailability,
|
||||
Monitor, MovieFile, Quality, QualityWrapper, Rating, RatingsList,
|
||||
BlocklistItem, BlocklistItemMovie, CollectionMovie, IndexerField, Language, MediaInfo,
|
||||
MinimumAvailability, Monitor, MovieCollection, MovieFile, Quality, QualityWrapper, Rating,
|
||||
RatingsList,
|
||||
};
|
||||
use crate::models::servarr_data::radarr::radarr_data::ActiveRadarrBlock;
|
||||
use crate::models::stateful_table::SortOption;
|
||||
@@ -1386,12 +1387,8 @@ mod test {
|
||||
id: 123,
|
||||
movie_id: 1007,
|
||||
source_title: "z movie".into(),
|
||||
movie: Movie {
|
||||
id: 1007,
|
||||
movie: BlocklistItemMovie {
|
||||
title: "z movie".into(),
|
||||
movie_file: None,
|
||||
collection: None,
|
||||
..movie()
|
||||
},
|
||||
..blocklist_item()
|
||||
},
|
||||
@@ -1399,12 +1396,8 @@ mod test {
|
||||
id: 456,
|
||||
movie_id: 2001,
|
||||
source_title: "A Movie".into(),
|
||||
movie: Movie {
|
||||
id: 2001,
|
||||
movie: BlocklistItemMovie {
|
||||
title: "A Movie".into(),
|
||||
movie_file: None,
|
||||
collection: None,
|
||||
..movie()
|
||||
},
|
||||
..blocklist_item()
|
||||
},
|
||||
@@ -3653,7 +3646,13 @@ mod test {
|
||||
protocol: "usenet".to_owned(),
|
||||
indexer: "DrunkenSlug (Prowlarr)".to_owned(),
|
||||
message: "test message".to_owned(),
|
||||
movie: movie(),
|
||||
movie: blocklist_item_movie(),
|
||||
}
|
||||
}
|
||||
|
||||
fn blocklist_item_movie() -> BlocklistItemMovie {
|
||||
BlocklistItemMovie {
|
||||
title: "Test".into(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3693,7 +3692,13 @@ mod test {
|
||||
tags: vec![Number::from(1)],
|
||||
ratings: ratings_list(),
|
||||
movie_file: Some(movie_file()),
|
||||
collection: Some(collection()),
|
||||
collection: Some(movie_collection()),
|
||||
}
|
||||
}
|
||||
|
||||
fn movie_collection() -> MovieCollection {
|
||||
MovieCollection {
|
||||
title: Some("Test Collection".to_owned()),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user