refactor: Let serde serialize Add Series and Add Movie enums instead of calling to_string up front
This commit is contained in:
@@ -122,12 +122,12 @@ impl<'a, 'b> CliCommandHandler<'a, 'b, RadarrAddCommand> for RadarrAddCommandHan
|
||||
title: String::new(),
|
||||
root_folder_path,
|
||||
quality_profile_id,
|
||||
minimum_availability: minimum_availability.to_string(),
|
||||
minimum_availability,
|
||||
monitored: !disable_monitoring,
|
||||
tags,
|
||||
tag_input_string: None,
|
||||
add_options: AddMovieOptions {
|
||||
monitor: monitor.to_string(),
|
||||
monitor,
|
||||
search_for_movie: !no_search_for_movie,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -384,12 +384,12 @@ mod tests {
|
||||
title: String::new(),
|
||||
root_folder_path: "/test".to_owned(),
|
||||
quality_profile_id: 1,
|
||||
minimum_availability: "released".to_owned(),
|
||||
minimum_availability: MinimumAvailability::Released,
|
||||
monitored: false,
|
||||
tags: vec![1, 2],
|
||||
tag_input_string: None,
|
||||
add_options: AddMovieOptions {
|
||||
monitor: "movieAndCollection".to_owned(),
|
||||
monitor: MovieMonitor::MovieAndCollection,
|
||||
search_for_movie: false,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -137,12 +137,12 @@ impl<'a, 'b> CliCommandHandler<'a, 'b, SonarrAddCommand> for SonarrAddCommandHan
|
||||
root_folder_path,
|
||||
quality_profile_id,
|
||||
language_profile_id,
|
||||
series_type: series_type.to_string(),
|
||||
series_type,
|
||||
season_folder: !disable_season_folders,
|
||||
tags,
|
||||
tag_input_string: None,
|
||||
add_options: AddSeriesOptions {
|
||||
monitor: monitor.to_string(),
|
||||
monitor,
|
||||
search_for_cutoff_unmet_episodes: !no_search_for_series,
|
||||
search_for_missing_episodes: !no_search_for_series,
|
||||
},
|
||||
|
||||
@@ -517,13 +517,13 @@ mod tests {
|
||||
root_folder_path: "/test".to_owned(),
|
||||
quality_profile_id: 1,
|
||||
language_profile_id: 1,
|
||||
series_type: "anime".to_owned(),
|
||||
series_type: SeriesType::Anime,
|
||||
monitored: false,
|
||||
tags: vec![1, 2],
|
||||
tag_input_string: None,
|
||||
season_folder: false,
|
||||
add_options: AddSeriesOptions {
|
||||
monitor: "future".to_owned(),
|
||||
monitor: SeriesMonitor::Future,
|
||||
search_for_cutoff_unmet_episodes: false,
|
||||
search_for_missing_episodes: false,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user