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:
+1
-1
@@ -9,7 +9,7 @@ repository = "https://github.com/Dark-Alex-17/managarr"
|
|||||||
homepage = "https://github.com/Dark-Alex-17/managarr"
|
homepage = "https://github.com/Dark-Alex-17/managarr"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
rust-version = "1.75.0"
|
rust-version = "1.76.0"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = "1.0.68"
|
anyhow = "1.0.68"
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ tautulli:
|
|||||||
* [reqwest](https://github.com/seanmonstar/reqwest)
|
* [reqwest](https://github.com/seanmonstar/reqwest)
|
||||||
|
|
||||||
## Servarr Requirements
|
## Servarr Requirements
|
||||||
* [Radarr >= v3](https://radarr.video/docs/api/)
|
* [Radarr >= 5.3.6.8612](https://radarr.video/docs/api/)
|
||||||
* [Sonarr >= v3](https://sonarr.tv/docs/api/)
|
* [Sonarr >= v3](https://sonarr.tv/docs/api/)
|
||||||
* [Readarr v1](https://readarr.com/docs/api/)
|
* [Readarr v1](https://readarr.com/docs/api/)
|
||||||
* [Lidarr v1](https://lidarr.audio/docs/api/)
|
* [Lidarr v1](https://lidarr.audio/docs/api/)
|
||||||
|
|||||||
@@ -5,7 +5,9 @@ mod tests {
|
|||||||
use crate::event::Key;
|
use crate::event::Key;
|
||||||
use crate::handlers::radarr_handlers::blocklist::{blocklist_sorting_options, BlocklistHandler};
|
use crate::handlers::radarr_handlers::blocklist::{blocklist_sorting_options, BlocklistHandler};
|
||||||
use crate::handlers::KeyEventHandler;
|
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::servarr_data::radarr::radarr_data::{ActiveRadarrBlock, BLOCKLIST_BLOCKS};
|
||||||
use crate::models::stateful_table::SortOption;
|
use crate::models::stateful_table::SortOption;
|
||||||
use chrono::DateTime;
|
use chrono::DateTime;
|
||||||
@@ -627,9 +629,8 @@ mod tests {
|
|||||||
name: "nikki".to_owned(),
|
name: "nikki".to_owned(),
|
||||||
}]),
|
}]),
|
||||||
date: DateTime::from(DateTime::parse_from_rfc3339("2024-01-10T07:28:45Z").unwrap()),
|
date: DateTime::from(DateTime::parse_from_rfc3339("2024-01-10T07:28:45Z").unwrap()),
|
||||||
movie: Movie {
|
movie: BlocklistItemMovie {
|
||||||
title: "test 3".into(),
|
title: "test 3".into(),
|
||||||
..Movie::default()
|
|
||||||
},
|
},
|
||||||
..BlocklistItem::default()
|
..BlocklistItem::default()
|
||||||
},
|
},
|
||||||
@@ -653,9 +654,8 @@ mod tests {
|
|||||||
},
|
},
|
||||||
]),
|
]),
|
||||||
date: DateTime::from(DateTime::parse_from_rfc3339("2024-02-10T07:28:45Z").unwrap()),
|
date: DateTime::from(DateTime::parse_from_rfc3339("2024-02-10T07:28:45Z").unwrap()),
|
||||||
movie: Movie {
|
movie: BlocklistItemMovie {
|
||||||
title: "test 2".into(),
|
title: "test 2".into(),
|
||||||
..Movie::default()
|
|
||||||
},
|
},
|
||||||
..BlocklistItem::default()
|
..BlocklistItem::default()
|
||||||
},
|
},
|
||||||
@@ -674,9 +674,8 @@ mod tests {
|
|||||||
name: "English".to_owned(),
|
name: "English".to_owned(),
|
||||||
}]),
|
}]),
|
||||||
date: DateTime::from(DateTime::parse_from_rfc3339("2024-03-10T07:28:45Z").unwrap()),
|
date: DateTime::from(DateTime::parse_from_rfc3339("2024-03-10T07:28:45Z").unwrap()),
|
||||||
movie: Movie {
|
movie: BlocklistItemMovie {
|
||||||
title: "test 1".into(),
|
title: "test 1".into(),
|
||||||
..Movie::default()
|
|
||||||
},
|
},
|
||||||
..BlocklistItem::default()
|
..BlocklistItem::default()
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -74,7 +74,12 @@ pub struct BlocklistItem {
|
|||||||
pub protocol: String,
|
pub protocol: String,
|
||||||
pub indexer: String,
|
pub indexer: String,
|
||||||
pub message: 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)]
|
#[derive(Deserialize, Derivative, Default, Clone, Debug, PartialEq, Eq)]
|
||||||
@@ -342,8 +347,7 @@ impl Monitor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Derivative, Deserialize, Debug, Clone, PartialEq, Eq)]
|
#[derive(Derivative, Deserialize, Debug, Default, Clone, PartialEq, Eq)]
|
||||||
#[derivative(Default)]
|
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct Movie {
|
pub struct Movie {
|
||||||
#[serde(deserialize_with = "super::from_i64")]
|
#[serde(deserialize_with = "super::from_i64")]
|
||||||
@@ -372,7 +376,13 @@ pub struct Movie {
|
|||||||
pub tags: Vec<Number>,
|
pub tags: Vec<Number>,
|
||||||
pub ratings: RatingsList,
|
pub ratings: RatingsList,
|
||||||
pub movie_file: Option<MovieFile>,
|
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)]
|
#[derive(Default, Serialize, Debug)]
|
||||||
@@ -382,8 +392,7 @@ pub struct MovieCommandBody {
|
|||||||
pub movie_ids: Vec<i64>,
|
pub movie_ids: Vec<i64>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize, Derivative, Debug, Clone, PartialEq, Eq)]
|
#[derive(Deserialize, Default, Debug, Clone, PartialEq, Eq)]
|
||||||
#[derivative(Default)]
|
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct MovieFile {
|
pub struct MovieFile {
|
||||||
pub relative_path: String,
|
pub relative_path: String,
|
||||||
|
|||||||
@@ -1195,7 +1195,11 @@ impl<'a, 'b> Network<'a, 'b> {
|
|||||||
Studio: {studio}
|
Studio: {studio}
|
||||||
Genres: {}",
|
Genres: {}",
|
||||||
certification.unwrap_or_default(),
|
certification.unwrap_or_default(),
|
||||||
collection.title,
|
collection
|
||||||
|
.title
|
||||||
|
.as_ref()
|
||||||
|
.unwrap_or(&String::new())
|
||||||
|
.to_owned(),
|
||||||
genres.join(", ")
|
genres.join(", ")
|
||||||
)),
|
)),
|
||||||
..MovieDetailsModal::default()
|
..MovieDetailsModal::default()
|
||||||
|
|||||||
@@ -13,8 +13,9 @@ mod test {
|
|||||||
use tokio_util::sync::CancellationToken;
|
use tokio_util::sync::CancellationToken;
|
||||||
|
|
||||||
use crate::models::radarr_models::{
|
use crate::models::radarr_models::{
|
||||||
BlocklistItem, CollectionMovie, IndexerField, Language, MediaInfo, MinimumAvailability,
|
BlocklistItem, BlocklistItemMovie, CollectionMovie, IndexerField, Language, MediaInfo,
|
||||||
Monitor, MovieFile, Quality, QualityWrapper, Rating, RatingsList,
|
MinimumAvailability, Monitor, MovieCollection, MovieFile, Quality, QualityWrapper, Rating,
|
||||||
|
RatingsList,
|
||||||
};
|
};
|
||||||
use crate::models::servarr_data::radarr::radarr_data::ActiveRadarrBlock;
|
use crate::models::servarr_data::radarr::radarr_data::ActiveRadarrBlock;
|
||||||
use crate::models::stateful_table::SortOption;
|
use crate::models::stateful_table::SortOption;
|
||||||
@@ -1386,12 +1387,8 @@ mod test {
|
|||||||
id: 123,
|
id: 123,
|
||||||
movie_id: 1007,
|
movie_id: 1007,
|
||||||
source_title: "z movie".into(),
|
source_title: "z movie".into(),
|
||||||
movie: Movie {
|
movie: BlocklistItemMovie {
|
||||||
id: 1007,
|
|
||||||
title: "z movie".into(),
|
title: "z movie".into(),
|
||||||
movie_file: None,
|
|
||||||
collection: None,
|
|
||||||
..movie()
|
|
||||||
},
|
},
|
||||||
..blocklist_item()
|
..blocklist_item()
|
||||||
},
|
},
|
||||||
@@ -1399,12 +1396,8 @@ mod test {
|
|||||||
id: 456,
|
id: 456,
|
||||||
movie_id: 2001,
|
movie_id: 2001,
|
||||||
source_title: "A Movie".into(),
|
source_title: "A Movie".into(),
|
||||||
movie: Movie {
|
movie: BlocklistItemMovie {
|
||||||
id: 2001,
|
|
||||||
title: "A Movie".into(),
|
title: "A Movie".into(),
|
||||||
movie_file: None,
|
|
||||||
collection: None,
|
|
||||||
..movie()
|
|
||||||
},
|
},
|
||||||
..blocklist_item()
|
..blocklist_item()
|
||||||
},
|
},
|
||||||
@@ -3653,7 +3646,13 @@ mod test {
|
|||||||
protocol: "usenet".to_owned(),
|
protocol: "usenet".to_owned(),
|
||||||
indexer: "DrunkenSlug (Prowlarr)".to_owned(),
|
indexer: "DrunkenSlug (Prowlarr)".to_owned(),
|
||||||
message: "test message".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)],
|
tags: vec![Number::from(1)],
|
||||||
ratings: ratings_list(),
|
ratings: ratings_list(),
|
||||||
movie_file: Some(movie_file()),
|
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