refactor: Let serde serialize Add Series and Add Movie enums instead of calling to_string up front
This commit is contained in:
@@ -83,8 +83,8 @@ impl AddMovieHandler<'_, '_> {
|
||||
.unwrap();
|
||||
|
||||
let path = root_folder_list.current_selection().path.clone();
|
||||
let monitor = monitor_list.current_selection().to_string();
|
||||
let minimum_availability = minimum_availability_list.current_selection().to_string();
|
||||
let monitor = *monitor_list.current_selection();
|
||||
let minimum_availability = *minimum_availability_list.current_selection();
|
||||
|
||||
AddMovieBody {
|
||||
tmdb_id,
|
||||
|
||||
@@ -5,7 +5,7 @@ pub(in crate::handlers::radarr_handlers) mod utils {
|
||||
use crate::models::radarr_models::{
|
||||
AddMovieBody, AddMovieOptions, AddMovieSearchResult, Collection, CollectionMovie,
|
||||
DownloadRecord, IndexerSettings, MediaInfo, MinimumAvailability, Movie, MovieCollection,
|
||||
MovieFile, RadarrRelease, Rating, RatingsList,
|
||||
MovieFile, MovieMonitor, RadarrRelease, Rating, RatingsList,
|
||||
};
|
||||
use crate::models::servarr_models::{
|
||||
Indexer, IndexerField, Language, Quality, QualityWrapper, RootFolder,
|
||||
@@ -470,13 +470,13 @@ pub(in crate::handlers::radarr_handlers) mod utils {
|
||||
tmdb_id: 1234,
|
||||
title: "Test".to_owned(),
|
||||
root_folder_path: "/nfs2".to_owned(),
|
||||
minimum_availability: "announced".to_owned(),
|
||||
minimum_availability: MinimumAvailability::Announced,
|
||||
monitored: true,
|
||||
quality_profile_id: 2222,
|
||||
tags: Vec::new(),
|
||||
tag_input_string: Some("usenet, testing".into()),
|
||||
add_options: AddMovieOptions {
|
||||
monitor: "movieOnly".to_owned(),
|
||||
monitor: MovieMonitor::MovieOnly,
|
||||
search_for_movie: true,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -74,8 +74,8 @@ impl AddSeriesHandler<'_, '_> {
|
||||
.unwrap();
|
||||
|
||||
let path = root_folder_list.current_selection().path.clone();
|
||||
let monitor = monitor_list.current_selection().to_string();
|
||||
let series_type = series_type_list.current_selection().to_string();
|
||||
let monitor = *monitor_list.current_selection();
|
||||
let series_type = *series_type_list.current_selection();
|
||||
|
||||
AddSeriesBody {
|
||||
tvdb_id,
|
||||
|
||||
@@ -1169,12 +1169,12 @@ mod tests {
|
||||
root_folder_path: "/nfs2".to_owned(),
|
||||
quality_profile_id: 2222,
|
||||
language_profile_id: 2222,
|
||||
series_type: "standard".to_owned(),
|
||||
series_type: SeriesType::Standard,
|
||||
season_folder: true,
|
||||
tags: Vec::default(),
|
||||
tag_input_string: Some("usenet, testing".to_owned()),
|
||||
add_options: AddSeriesOptions {
|
||||
monitor: "all".to_owned(),
|
||||
monitor: SeriesMonitor::All,
|
||||
search_for_cutoff_unmet_episodes: true,
|
||||
search_for_missing_episodes: true,
|
||||
},
|
||||
@@ -1647,12 +1647,12 @@ mod tests {
|
||||
root_folder_path: "/nfs2".to_owned(),
|
||||
quality_profile_id: 2222,
|
||||
language_profile_id: 2222,
|
||||
series_type: "standard".to_owned(),
|
||||
series_type: SeriesType::Standard,
|
||||
season_folder: true,
|
||||
tags: Vec::default(),
|
||||
tag_input_string: Some("usenet, testing".to_owned()),
|
||||
add_options: AddSeriesOptions {
|
||||
monitor: "all".to_owned(),
|
||||
monitor: SeriesMonitor::All,
|
||||
search_for_cutoff_unmet_episodes: true,
|
||||
search_for_missing_episodes: true,
|
||||
},
|
||||
@@ -1777,12 +1777,12 @@ mod tests {
|
||||
root_folder_path: "/nfs2".to_owned(),
|
||||
quality_profile_id: 2222,
|
||||
language_profile_id: 2222,
|
||||
series_type: "standard".to_owned(),
|
||||
series_type: SeriesType::Standard,
|
||||
season_folder: true,
|
||||
tags: Vec::default(),
|
||||
tag_input_string: Some("usenet, testing".to_owned()),
|
||||
add_options: AddSeriesOptions {
|
||||
monitor: "all".to_owned(),
|
||||
monitor: SeriesMonitor::All,
|
||||
search_for_cutoff_unmet_episodes: true,
|
||||
search_for_missing_episodes: true,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user