feat(models): Stubbed out the necessary ActiveSonarrBlocks for the UI mockup
This commit is contained in:
@@ -9,8 +9,6 @@ pub struct EpisodeDetailsModal {
|
|||||||
pub audio_details: String,
|
pub audio_details: String,
|
||||||
pub video_details: String,
|
pub video_details: String,
|
||||||
// pub episode_history: StatefulTable<MovieHistoryItem>,
|
// pub episode_history: StatefulTable<MovieHistoryItem>,
|
||||||
// pub episode_cast: StatefulTable<Credit>,
|
|
||||||
// pub episode_crew: StatefulTable<Credit>,
|
|
||||||
pub episode_releases: StatefulTable<Release>,
|
pub episode_releases: StatefulTable<Release>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -52,15 +52,74 @@ impl Default for SonarrData {
|
|||||||
|
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, Default, EnumIter)]
|
#[derive(Clone, Copy, PartialEq, Eq, Debug, Default, EnumIter)]
|
||||||
pub enum ActiveSonarrBlock {
|
pub enum ActiveSonarrBlock {
|
||||||
Blocklist,
|
|
||||||
BlocklistSortPrompt,
|
|
||||||
Episodes,
|
|
||||||
EpisodesSortPrompt,
|
|
||||||
Seasons,
|
|
||||||
SeasonsSortPrompt,
|
|
||||||
#[default]
|
#[default]
|
||||||
Series,
|
Series,
|
||||||
|
UpdateAndScanSeriesPrompt,
|
||||||
|
EditSeriesPrompt,
|
||||||
SeriesSortPrompt,
|
SeriesSortPrompt,
|
||||||
|
SearchSeries,
|
||||||
|
SearchSeriesError,
|
||||||
|
FilterSeries,
|
||||||
|
FilterSeriesError,
|
||||||
|
DeleteSeriesPrompt,
|
||||||
|
DeleteSeriesConfirmPrompt,
|
||||||
|
AutomaticallySearchSeriesPrompt,
|
||||||
|
UpdateAllSeriesPrompt,
|
||||||
|
SeriesDetails,
|
||||||
|
SeriesHistory,
|
||||||
|
HistoryDetails,
|
||||||
|
MarkHistoryItemAsFailurePrompt,
|
||||||
|
MarkHistoryItemAsFailureConfirmPrompt,
|
||||||
|
SearchSeason,
|
||||||
|
SearchSeasonError,
|
||||||
|
AutomaticallySearchSeasonPrompt,
|
||||||
|
SeasonDetails,
|
||||||
|
SeasonHistory,
|
||||||
|
ManualSeasonSearch,
|
||||||
|
ManualSeasonSearchSortPrompt,
|
||||||
|
ManualSeasonSearchConfirmPrompt,
|
||||||
|
DeleteEpisodeFilePrompt,
|
||||||
|
EpisodeDetails,
|
||||||
|
EpisodesSortPrompt,
|
||||||
|
SearchEpisodes,
|
||||||
|
SearchEpisodesError,
|
||||||
|
FilterEpisodes,
|
||||||
|
FilterEpisodesError,
|
||||||
|
AutomaticallySearchEpisodePrompt,
|
||||||
|
EditEpisodePrompt,
|
||||||
|
EpisodeHistory,
|
||||||
|
EpisodeFile,
|
||||||
|
ManualEpisodeSearch,
|
||||||
|
ManualEpisodeSearchSortPrompt,
|
||||||
|
ManualEpisodeSearchConfirmPrompt,
|
||||||
|
AddSeriesPrompt,
|
||||||
|
AddSeriesSearchInput,
|
||||||
|
AddSeriesSearchResults,
|
||||||
|
AddSeriesAlreadyInLibrary,
|
||||||
|
AddSeriesEmptySearchResults,
|
||||||
|
AddSeriesConfirmPrompt,
|
||||||
|
Downloads,
|
||||||
|
DeleteDownloadPrompt,
|
||||||
|
Blocklist,
|
||||||
|
BlocklistClearAllItemsPrompt,
|
||||||
|
BlocklistItemDetails,
|
||||||
|
BlocklistSortPrompt,
|
||||||
|
DeleteBlocklistItemPrompt,
|
||||||
|
RootFolders,
|
||||||
|
AddRootFolderPrompt,
|
||||||
|
DeleteRootFolderPrompt,
|
||||||
|
Indexers,
|
||||||
|
DeleteIndexerPrompt,
|
||||||
|
EditIndexerPrompt,
|
||||||
|
AllIndexerSettingsPrompt,
|
||||||
|
TestIndexer,
|
||||||
|
TestAllIndexers,
|
||||||
|
System,
|
||||||
|
SystemTasks,
|
||||||
|
SystemTaskStartConfirmPrompt,
|
||||||
|
SystemLogs,
|
||||||
|
SystemQueuedEvents,
|
||||||
|
SystemUpdates,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<ActiveSonarrBlock> for Route {
|
impl From<ActiveSonarrBlock> for Route {
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ pub struct IndexerField {
|
|||||||
pub value: Option<Value>,
|
pub value: Option<Value>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Default, Hash, Debug, Clone, PartialEq, Eq, Ord, PartialOrd)]
|
#[derive(Serialize, Deserialize, Default, Debug, Clone, PartialEq, Eq, Ord, PartialOrd)]
|
||||||
pub struct Language {
|
pub struct Language {
|
||||||
pub name: String,
|
pub name: String,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ pub struct DownloadsResponse {
|
|||||||
pub records: Vec<DownloadRecord>,
|
pub records: Vec<DownloadRecord>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Default, Serialize, Deserialize, Hash, Debug, Clone, PartialEq, Eq)]
|
#[derive(Default, Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct Episode {
|
pub struct Episode {
|
||||||
#[serde(deserialize_with = "super::from_i64")]
|
#[serde(deserialize_with = "super::from_i64")]
|
||||||
@@ -97,7 +97,7 @@ impl Display for Episode {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Default, Serialize, Deserialize, Hash, Debug, Clone, PartialEq, Eq)]
|
#[derive(Default, Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct EpisodeFile {
|
pub struct EpisodeFile {
|
||||||
pub relative_path: String,
|
pub relative_path: String,
|
||||||
@@ -124,7 +124,7 @@ pub struct IndexerSettings {
|
|||||||
pub rss_sync_interval: i64,
|
pub rss_sync_interval: i64,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Derivative, Hash, Debug, Clone, PartialEq, Eq)]
|
#[derive(Serialize, Deserialize, Derivative, Debug, Clone, PartialEq, Eq)]
|
||||||
#[derivative(Default)]
|
#[derivative(Default)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct MediaInfo {
|
pub struct MediaInfo {
|
||||||
@@ -304,6 +304,34 @@ impl SeriesStatus {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Serialize, Deserialize, Default, Debug, Clone, PartialEq, Eq)]
|
||||||
|
#[serde(rename_all = "camelCase")]
|
||||||
|
pub struct SonarrEpisodeHistoryResponse {
|
||||||
|
pub records: Vec<SonarrHistoryItem>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Serialize, Deserialize, Default, Debug, Clone, PartialEq, Eq)]
|
||||||
|
#[serde(rename_all = "camelCase")]
|
||||||
|
pub struct SonarrHistoryData {
|
||||||
|
pub dropped_path: String,
|
||||||
|
pub imported_path: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Serialize, Deserialize, Default, Debug, Clone, PartialEq, Eq)]
|
||||||
|
#[serde(rename_all = "camelCase")]
|
||||||
|
pub struct SonarrHistoryItem {
|
||||||
|
#[serde(deserialize_with = "super::from_i64")]
|
||||||
|
pub id: i64,
|
||||||
|
pub source_title: HorizontallyScrollableText,
|
||||||
|
#[serde(deserialize_with = "super::from_i64")]
|
||||||
|
pub episode_id: i64,
|
||||||
|
pub quality: QualityWrapper,
|
||||||
|
pub languages: Vec<Language>,
|
||||||
|
pub date: DateTime<Utc>,
|
||||||
|
pub event_type: String,
|
||||||
|
pub data: SonarrHistoryData,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Clone, Serialize, Deserialize, Debug, PartialEq, Eq)]
|
#[derive(Clone, Serialize, Deserialize, Debug, PartialEq, Eq)]
|
||||||
#[serde(untagged)]
|
#[serde(untagged)]
|
||||||
#[allow(clippy::large_enum_variant)]
|
#[allow(clippy::large_enum_variant)]
|
||||||
|
|||||||
@@ -855,7 +855,7 @@ mod test {
|
|||||||
app_arc
|
app_arc
|
||||||
.lock()
|
.lock()
|
||||||
.await
|
.await
|
||||||
.push_navigation_stack(ActiveSonarrBlock::Episodes.into());
|
.push_navigation_stack(ActiveSonarrBlock::EpisodeDetails.into());
|
||||||
let mut network = Network::new(&app_arc, CancellationToken::new(), Client::new());
|
let mut network = Network::new(&app_arc, CancellationToken::new(), Client::new());
|
||||||
|
|
||||||
if let SonarrSerdeable::Episode(episode) = network
|
if let SonarrSerdeable::Episode(episode) = network
|
||||||
@@ -2155,7 +2155,7 @@ mod test {
|
|||||||
app_arc
|
app_arc
|
||||||
.lock()
|
.lock()
|
||||||
.await
|
.await
|
||||||
.push_navigation_stack(ActiveSonarrBlock::Episodes.into());
|
.push_navigation_stack(ActiveSonarrBlock::EpisodeDetails.into());
|
||||||
let mut network = Network::new(&app_arc, CancellationToken::new(), Client::new());
|
let mut network = Network::new(&app_arc, CancellationToken::new(), Client::new());
|
||||||
|
|
||||||
let id = network.extract_episode_id(None).await;
|
let id = network.extract_episode_id(None).await;
|
||||||
@@ -2175,7 +2175,7 @@ mod test {
|
|||||||
app_arc
|
app_arc
|
||||||
.lock()
|
.lock()
|
||||||
.await
|
.await
|
||||||
.push_navigation_stack(ActiveSonarrBlock::Episodes.into());
|
.push_navigation_stack(ActiveSonarrBlock::EpisodeDetails.into());
|
||||||
let mut network = Network::new(&app_arc, CancellationToken::new(), Client::new());
|
let mut network = Network::new(&app_arc, CancellationToken::new(), Client::new());
|
||||||
|
|
||||||
let id = network.extract_episode_id(Some(2)).await;
|
let id = network.extract_episode_id(Some(2)).await;
|
||||||
@@ -2199,7 +2199,7 @@ mod test {
|
|||||||
app_arc
|
app_arc
|
||||||
.lock()
|
.lock()
|
||||||
.await
|
.await
|
||||||
.push_navigation_stack(ActiveSonarrBlock::Episodes.into());
|
.push_navigation_stack(ActiveSonarrBlock::EpisodeDetails.into());
|
||||||
let mut network = Network::new(&app_arc, CancellationToken::new(), Client::new());
|
let mut network = Network::new(&app_arc, CancellationToken::new(), Client::new());
|
||||||
|
|
||||||
let id = network.extract_episode_id(None).await;
|
let id = network.extract_episode_id(None).await;
|
||||||
|
|||||||
Reference in New Issue
Block a user