Refactor analysis input building
Extract the logic for building `AnalysisInput` into a new function `build_analysis_input`. This function encapsulates the process of collecting recordings, reading transcripts, and determining the last recording modification time. This change improves code organization and reusability by centralizing the input building logic.
This commit is contained in:
@@ -25,6 +25,12 @@ pub struct AuthenticatedUser {
|
||||
pub data_dir: PathBuf,
|
||||
}
|
||||
|
||||
impl AuthenticatedUser {
|
||||
pub fn is_admin(&self) -> bool {
|
||||
self.role == "admin"
|
||||
}
|
||||
}
|
||||
|
||||
impl<S> FromRequestParts<S> for AuthenticatedUser
|
||||
where
|
||||
S: Send + Sync,
|
||||
@@ -72,6 +78,12 @@ pub struct AuthenticatedWebUser {
|
||||
pub data_dir: PathBuf,
|
||||
}
|
||||
|
||||
impl AuthenticatedWebUser {
|
||||
pub fn is_admin(&self) -> bool {
|
||||
self.role == "admin"
|
||||
}
|
||||
}
|
||||
|
||||
impl<S> FromRequestParts<S> for AuthenticatedWebUser
|
||||
where
|
||||
S: Send + Sync,
|
||||
|
||||
Reference in New Issue
Block a user