Invert backup/setup bool
This commit is contained in:
parent
87ccc80602
commit
cb7ba1a285
3 changed files with 7 additions and 7 deletions
|
|
@ -158,7 +158,7 @@ impl App {
|
||||||
&& let Some(index) = self.state.wim_image_index
|
&& let Some(index) = self.state.wim_image_index
|
||||||
{
|
{
|
||||||
let image = wim_sources.get_file(index);
|
let image = wim_sources.get_file(index);
|
||||||
if !image.is_setup {
|
if image.is_backup {
|
||||||
self.action_tx.send(Action::NextScreen)?;
|
self.action_tx.send(Action::NextScreen)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -729,7 +729,7 @@ fn build_right_items(app: &App) -> Action {
|
||||||
DVLine::blank(),
|
DVLine::blank(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
if wim_file.is_setup
|
if !wim_file.is_backup
|
||||||
&& let Some(username) = &app.state.username
|
&& let Some(username) = &app.state.username
|
||||||
{
|
{
|
||||||
label_dv_lines.append(&mut vec![DVLine {
|
label_dv_lines.append(&mut vec![DVLine {
|
||||||
|
|
|
||||||
|
|
@ -154,13 +154,13 @@ pub fn scan_local_drives(
|
||||||
|
|
||||||
// Scan drives
|
// Scan drives
|
||||||
to_check.iter().for_each(|scan_path| {
|
to_check.iter().for_each(|scan_path| {
|
||||||
let is_setup = scan_path.ends_with("\\Images");
|
let is_backup = !scan_path.ends_with("\\Images");
|
||||||
if let Ok(read_dir) = read_dir(scan_path) {
|
if let Ok(read_dir) = read_dir(scan_path) {
|
||||||
read_dir.for_each(|item| {
|
read_dir.for_each(|item| {
|
||||||
if let Ok(item) = item
|
if let Ok(item) = item
|
||||||
&& item.file_name().to_string_lossy().ends_with(".wim")
|
&& item.file_name().to_string_lossy().ends_with(".wim")
|
||||||
&& let Some(path_str) = item.path().to_str()
|
&& let Some(path_str) = item.path().to_str()
|
||||||
&& let Ok(new_source) = parse_wim_file(path_str, is_setup)
|
&& let Ok(new_source) = parse_wim_file(path_str, is_backup)
|
||||||
{
|
{
|
||||||
wim_files.push(new_source);
|
wim_files.push(new_source);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ static WIN_BUILDS: LazyLock<HashMap<&str, &str>> = LazyLock::new(|| {
|
||||||
pub struct WimFile {
|
pub struct WimFile {
|
||||||
pub path: String,
|
pub path: String,
|
||||||
pub images: Vec<WimImage>,
|
pub images: Vec<WimImage>,
|
||||||
pub is_setup: bool,
|
pub is_backup: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl WimFile {
|
impl WimFile {
|
||||||
|
|
@ -237,7 +237,7 @@ fn get_wim_xml(wim_file: &str) -> std::io::Result<File> {
|
||||||
Ok(file)
|
Ok(file)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn parse_wim_file(wim_file: &str, is_setup: bool) -> std::io::Result<WimFile> {
|
pub fn parse_wim_file(wim_file: &str, is_backup: bool) -> std::io::Result<WimFile> {
|
||||||
let mut wim_images: Vec<WimImage> = Vec::new();
|
let mut wim_images: Vec<WimImage> = Vec::new();
|
||||||
if !Path::new(wim_file).exists() {
|
if !Path::new(wim_file).exists() {
|
||||||
return Err(std::io::Error::new(
|
return Err(std::io::Error::new(
|
||||||
|
|
@ -316,7 +316,7 @@ pub fn parse_wim_file(wim_file: &str, is_setup: bool) -> std::io::Result<WimFile
|
||||||
let wim_file = WimFile {
|
let wim_file = WimFile {
|
||||||
path: wim_file.to_string(),
|
path: wim_file.to_string(),
|
||||||
images: wim_images,
|
images: wim_images,
|
||||||
is_setup,
|
is_backup,
|
||||||
};
|
};
|
||||||
|
|
||||||
Ok(wim_file)
|
Ok(wim_file)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue