feat(network): Support for adding a new series to Sonarr

This commit is contained in:
2024-11-24 13:18:02 -07:00
parent c98828aec7
commit 5ba3f2b1ba
9 changed files with 668 additions and 26 deletions
+31 -4
View File
@@ -27,19 +27,46 @@ mod sonarr_models_tests;
pub struct AddSeriesBody {
pub tvdb_id: i64,
pub title: String,
pub monitored: bool,
pub root_folder_path: String,
pub quality_profile_id: i64,
pub series_type: SeriesType,
pub season_folder: bool,
pub language_profile_id: i64,
pub series_type: String,
pub season_folder: bool,
pub tags: Vec<i64>,
pub add_options: AddSeriesOptions,
}
#[derive(Derivative, Serialize, Deserialize, Debug, Default, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct AddSeriesSearchResult {
#[serde(deserialize_with = "super::from_i64")]
pub tvdb_id: i64,
pub title: HorizontallyScrollableText,
pub status: Option<String>,
pub ended: bool,
pub overview: Option<String>,
pub genres: Vec<String>,
#[serde(deserialize_with = "super::from_i64")]
pub year: i64,
pub network: Option<String>,
#[serde(deserialize_with = "super::from_i64")]
pub runtime: i64,
pub ratings: Option<Rating>,
pub statistics: Option<AddSeriesSearchResultStatistics>,
}
#[derive(Derivative, Serialize, Deserialize, Debug, Default, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct AddSeriesSearchResultStatistics {
#[serde(deserialize_with = "super::from_i64")]
pub season_count: i64,
}
#[derive(Default, Clone, Serialize, Debug, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct AddSeriesOptions {
pub monitor: SeriesMonitor,
pub monitor: String,
pub search_for_cutoff_unmet_episodes: bool,
pub search_for_missing_episodes: bool,
}
@@ -258,9 +285,9 @@ pub struct Series {
)]
#[serde(rename_all = "camelCase")]
pub enum SeriesMonitor {
Unknown,
#[default]
All,
Unknown,
Future,
Missing,
Existing,