feat(cli): Sonarr support for fetching season history events

This commit is contained in:
2024-12-09 14:30:07 -07:00
parent 5b65e87225
commit 6427a80bd1
4 changed files with 126 additions and 15 deletions
+3 -3
View File
@@ -1895,7 +1895,7 @@ impl<'a, 'b> Network<'a, 'b> {
async fn get_sonarr_season_history(
&mut self,
series_season_id_tuple: Option<(i64, i64)>,
) -> Result<SonarrHistoryWrapper> {
) -> Result<Vec<SonarrHistoryItem>> {
let event = SonarrEvent::GetSeasonHistory(None);
let (series_id, season_number) =
if let Some((series_id, season_number)) = series_season_id_tuple {
@@ -1915,12 +1915,12 @@ impl<'a, 'b> Network<'a, 'b> {
.await;
self
.handle_request::<(), SonarrHistoryWrapper>(request_props, |history_response, mut app| {
.handle_request::<(), Vec<SonarrHistoryItem>>(request_props, |history_items, mut app| {
if app.data.sonarr_data.season_details_modal.is_none() {
app.data.sonarr_data.season_details_modal = Some(SeasonDetailsModal::default());
}
let mut history_vec = history_response.records;
let mut history_vec = history_items;
history_vec.sort_by(|a, b| a.id.cmp(&b.id));
app
.data