Added better support for contexts now and improved base Radarr UI
This commit is contained in:
+35
-3
@@ -1,7 +1,9 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use chrono::{DateTime, Utc};
|
||||
|
||||
use crate::app::StatefulTable;
|
||||
use crate::network::radarr::Movie;
|
||||
use crate::app::{App, StatefulTable};
|
||||
use crate::network::radarr_network::{DownloadRecord, Movie, RadarrEvent};
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct RadarrData {
|
||||
@@ -9,5 +11,35 @@ pub struct RadarrData {
|
||||
pub total_space: u64,
|
||||
pub version: String,
|
||||
pub start_time: DateTime<Utc>,
|
||||
pub movies: StatefulTable<Movie>
|
||||
pub movies: StatefulTable<Movie>,
|
||||
pub downloads: StatefulTable<DownloadRecord>,
|
||||
pub quality_profile_map: HashMap<u64, String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Eq)]
|
||||
pub enum ActiveRadarrBlock {
|
||||
AddMovie,
|
||||
Calendar,
|
||||
Collections,
|
||||
Events,
|
||||
Logs,
|
||||
Movies,
|
||||
MovieDetails,
|
||||
Downloads,
|
||||
SearchMovie,
|
||||
SortOptions,
|
||||
Tasks,
|
||||
}
|
||||
|
||||
impl App {
|
||||
pub(super) async fn dispatch_by_radarr_block(&mut self, active_radarr_block: ActiveRadarrBlock) {
|
||||
match active_radarr_block {
|
||||
ActiveRadarrBlock::Downloads => self.dispatch(RadarrEvent::GetDownloads.into()).await,
|
||||
ActiveRadarrBlock::Movies => {
|
||||
self.dispatch(RadarrEvent::GetMovies.into()).await;
|
||||
self.dispatch(RadarrEvent::GetDownloads.into()).await;
|
||||
},
|
||||
_ => ()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user