feat(network): Support to fetch all Sonarr history events

This commit is contained in:
2024-11-20 14:06:44 -07:00
parent b8c60bf59a
commit 6da1ae93ef
5 changed files with 392 additions and 5 deletions
+18 -1
View File
@@ -9,7 +9,8 @@ mod tests {
},
sonarr_models::{
BlocklistItem, BlocklistResponse, DownloadRecord, DownloadsResponse, Episode,
IndexerSettings, Series, SeriesStatus, SeriesType, SonarrSerdeable, SystemStatus,
IndexerSettings, Series, SeriesStatus, SeriesType, SonarrHistoryItem, SonarrHistoryWrapper,
SonarrSerdeable, SystemStatus,
},
Serdeable,
};
@@ -167,6 +168,22 @@ mod tests {
assert_eq!(sonarr_serdeable, SonarrSerdeable::Series(series));
}
#[test]
fn test_sonarr_serdeable_from_sonarr_history_wrapper() {
let history_wrapper = SonarrHistoryWrapper {
records: vec![SonarrHistoryItem {
id: 1,
..SonarrHistoryItem::default()
}],
};
let sonarr_serdeable: SonarrSerdeable = history_wrapper.clone().into();
assert_eq!(
sonarr_serdeable,
SonarrSerdeable::SonarrHistoryWrapper(history_wrapper)
);
}
#[test]
fn test_sonarr_serdeable_from_system_status() {
let system_status = SystemStatus {