feat(cli): Support for fetching all Sonarr history events

This commit is contained in:
2024-11-20 14:13:20 -07:00
parent 6da1ae93ef
commit 5872a6ba72
3 changed files with 62 additions and 7 deletions
+5 -5
View File
@@ -108,8 +108,8 @@ impl<'a, 'b> Network<'a, 'b> {
.get_episode_details(episode_id)
.await
.map(SonarrSerdeable::from),
SonarrEvent::GetHistory(items) => self
.get_sonarr_history(items)
SonarrEvent::GetHistory(events) => self
.get_sonarr_history(events)
.await
.map(SonarrSerdeable::from),
SonarrEvent::GetHostConfig => self
@@ -467,13 +467,13 @@ impl<'a, 'b> Network<'a, 'b> {
.await
}
async fn get_sonarr_history(&mut self, items: Option<u64>) -> Result<SonarrHistoryWrapper> {
async fn get_sonarr_history(&mut self, events: Option<u64>) -> Result<SonarrHistoryWrapper> {
info!("Fetching all Sonarr history events");
let event = SonarrEvent::GetHistory(items);
let event = SonarrEvent::GetHistory(events);
let params = format!(
"pageSize={}&sortDirection=descending&sortKey=time",
items.unwrap_or(500)
events.unwrap_or(500)
);
let request_props = self
.request_props_from(event, RequestMethod::Get, None::<()>, None, Some(params))