refactor: Corrected some clone instead of copy behaviors in the command line handlers
This commit is contained in:
+3
-11
@@ -158,9 +158,7 @@ impl<'a> App<'a> {
|
|||||||
if self.data.radarr_data.prompt_confirm {
|
if self.data.radarr_data.prompt_confirm {
|
||||||
self.data.radarr_data.prompt_confirm = false;
|
self.data.radarr_data.prompt_confirm = false;
|
||||||
if let Some(radarr_event) = self.data.radarr_data.prompt_confirm_action.take() {
|
if let Some(radarr_event) = self.data.radarr_data.prompt_confirm_action.take() {
|
||||||
self
|
self.dispatch_network_event(radarr_event.into()).await;
|
||||||
.dispatch_network_event(radarr_event.into())
|
|
||||||
.await;
|
|
||||||
self.should_refresh = true;
|
self.should_refresh = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -230,7 +228,7 @@ impl<'a> App<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fn extract_movie_id(&self) -> i64 {
|
async fn extract_movie_id(&self) -> i64 {
|
||||||
self.data.radarr_data.movies.current_selection().clone().id
|
self.data.radarr_data.movies.current_selection().id
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn extract_movie_search_query(&self) -> String {
|
async fn extract_movie_search_query(&self) -> String {
|
||||||
@@ -245,12 +243,6 @@ impl<'a> App<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fn extract_radarr_indexer_id(&self) -> i64 {
|
async fn extract_radarr_indexer_id(&self) -> i64 {
|
||||||
self
|
self.data.radarr_data.indexers.current_selection().id
|
||||||
.data
|
|
||||||
.radarr_data
|
|
||||||
.indexers
|
|
||||||
.current_selection()
|
|
||||||
.clone()
|
|
||||||
.id
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -379,13 +379,7 @@ impl<'a, 'b> CliCommandHandler<'a, 'b, RadarrEditCommand> for RadarrEditCommandH
|
|||||||
rss_sync_interval: rss_sync_interval
|
rss_sync_interval: rss_sync_interval
|
||||||
.unwrap_or(previous_indexer_settings.rss_sync_interval),
|
.unwrap_or(previous_indexer_settings.rss_sync_interval),
|
||||||
whitelisted_hardcoded_subs: whitelisted_subtitle_tags
|
whitelisted_hardcoded_subs: whitelisted_subtitle_tags
|
||||||
.clone()
|
.unwrap_or(previous_indexer_settings.whitelisted_hardcoded_subs.text)
|
||||||
.unwrap_or_else(|| {
|
|
||||||
previous_indexer_settings
|
|
||||||
.whitelisted_hardcoded_subs
|
|
||||||
.text
|
|
||||||
.clone()
|
|
||||||
})
|
|
||||||
.into(),
|
.into(),
|
||||||
};
|
};
|
||||||
self
|
self
|
||||||
|
|||||||
@@ -135,9 +135,9 @@ impl<'a, 'b> CliCommandHandler<'a, 'b, RadarrListCommand> for RadarrListCommandH
|
|||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
if output_in_log_format {
|
if output_in_log_format {
|
||||||
let log_lines = self.app.lock().await.data.radarr_data.logs.items.clone();
|
let log_lines = &self.app.lock().await.data.radarr_data.logs.items;
|
||||||
|
|
||||||
serde_json::to_string_pretty(&log_lines)?
|
serde_json::to_string_pretty(log_lines)?
|
||||||
} else {
|
} else {
|
||||||
serde_json::to_string_pretty(&logs)?
|
serde_json::to_string_pretty(&logs)?
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -212,9 +212,9 @@ impl<'a, 'b> CliCommandHandler<'a, 'b, SonarrListCommand> for SonarrListCommandH
|
|||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
if output_in_log_format {
|
if output_in_log_format {
|
||||||
let log_lines = self.app.lock().await.data.sonarr_data.logs.items.clone();
|
let log_lines = &self.app.lock().await.data.sonarr_data.logs.items;
|
||||||
|
|
||||||
serde_json::to_string_pretty(&log_lines)?
|
serde_json::to_string_pretty(log_lines)?
|
||||||
} else {
|
} else {
|
||||||
serde_json::to_string_pretty(&logs)?
|
serde_json::to_string_pretty(&logs)?
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user