feat(ui): Sonarr support for viewing season details
This commit is contained in:
@@ -31,7 +31,7 @@ use crate::{
|
||||
network::RequestMethod,
|
||||
utils::convert_to_gb,
|
||||
};
|
||||
|
||||
use crate::models::sonarr_models::DownloadStatus;
|
||||
use super::{Network, NetworkEvent, NetworkResource};
|
||||
#[cfg(test)]
|
||||
#[path = "sonarr_network_tests.rs"]
|
||||
@@ -2642,11 +2642,11 @@ fn get_episode_status(has_file: bool, downloads_vec: &[DownloadRecord], episode_
|
||||
.iter()
|
||||
.find(|&download| download.episode_id == episode_id)
|
||||
{
|
||||
if download.status == "downloading" {
|
||||
if download.status == DownloadStatus::Downloading {
|
||||
return "Downloading".to_owned();
|
||||
}
|
||||
|
||||
if download.status == "completed" {
|
||||
if download.status == DownloadStatus::Completed {
|
||||
return "Awaiting Import".to_owned();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,10 +15,7 @@ mod test {
|
||||
use tokio::sync::Mutex;
|
||||
use tokio_util::sync::CancellationToken;
|
||||
|
||||
use crate::models::sonarr_models::{
|
||||
AddSeriesBody, AddSeriesOptions, AddSeriesSearchResult, AddSeriesSearchResultStatistics,
|
||||
EditSeriesParams, IndexerSettings, SeriesMonitor, SonarrHistoryEventType,
|
||||
};
|
||||
use crate::models::sonarr_models::{AddSeriesBody, AddSeriesOptions, AddSeriesSearchResult, AddSeriesSearchResultStatistics, DownloadStatus, EditSeriesParams, IndexerSettings, SeriesMonitor, SonarrHistoryEventType};
|
||||
|
||||
use crate::app::{App, ServarrConfig};
|
||||
use crate::models::radarr_models::IndexerTestResult;
|
||||
@@ -7167,7 +7164,7 @@ mod test {
|
||||
false,
|
||||
&[DownloadRecord {
|
||||
episode_id: 1,
|
||||
status: "downloading".to_owned(),
|
||||
status: DownloadStatus::Downloading,
|
||||
..DownloadRecord::default()
|
||||
}],
|
||||
1
|
||||
@@ -7183,7 +7180,7 @@ mod test {
|
||||
false,
|
||||
&[DownloadRecord {
|
||||
episode_id: 1,
|
||||
status: "completed".to_owned(),
|
||||
status: DownloadStatus::Completed,
|
||||
..DownloadRecord::default()
|
||||
}],
|
||||
1
|
||||
@@ -7231,7 +7228,7 @@ mod test {
|
||||
fn download_record() -> DownloadRecord {
|
||||
DownloadRecord {
|
||||
title: "Test Download Title".to_owned(),
|
||||
status: "downloading".to_owned(),
|
||||
status: DownloadStatus::Downloading,
|
||||
id: 1,
|
||||
episode_id: 1,
|
||||
size: 3543348019f64,
|
||||
|
||||
Reference in New Issue
Block a user