Fix showing results screen

This commit is contained in:
Martin Brodbeck 2021-02-12 09:34:58 +01:00
parent a9620b3e34
commit 577ae2b889

View file

@ -121,6 +121,15 @@ struct Statistics {
sorting_fixed: usize, sorting_fixed: usize,
} }
impl Statistics {
fn anything_fixed(&self) -> bool {
&self.authors_fixed > &0
|| &self.genres_fixed > &0
|| &self.ghost_books_cleaned > &0
|| &self.sorting_fixed > &0
}
}
fn fix_db_entries(tx: &Transaction, book_entries: &Vec<BookEntry>) -> Statistics { fn fix_db_entries(tx: &Transaction, book_entries: &Vec<BookEntry>) -> Statistics {
let mut stat = Statistics { let mut stat = Statistics {
authors_fixed: 0, authors_fixed: 0,
@ -254,7 +263,7 @@ fn main() {
tx.commit().unwrap(); tx.commit().unwrap();
if cfg!(target_arch = "arm") { if cfg!(target_arch = "arm") {
if stat.authors_fixed == 0 { if stat.anything_fixed() == false {
if stat.drm_skipped == 0 { if stat.drm_skipped == 0 {
pocketbook::dialog( pocketbook::dialog(
pocketbook::Icon::Info, pocketbook::Icon::Info,