Probably last part
This commit is contained in:
parent
7437757808
commit
b89d7ea00b
2 changed files with 37 additions and 32 deletions
|
@ -144,7 +144,7 @@ impl SameMusic {
|
||||||
use_reference_folders: false,
|
use_reference_folders: false,
|
||||||
duplicated_music_entries_referenced: vec![],
|
duplicated_music_entries_referenced: vec![],
|
||||||
save_also_as_json: false,
|
save_also_as_json: false,
|
||||||
check_type: AudioCheckMethod::Content,
|
check_type: AudioCheckMethod::Tags,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -660,10 +660,7 @@ impl SimilarImages {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(debug_assertions)]
|
debug_check_for_duplicated_things(self.use_reference_folders, &hashes_parents, &hashes_similarity, all_hashed_images, "BEFORE");
|
||||||
if !self.use_reference_folders {
|
|
||||||
debug_check_for_duplicated_things(&hashes_parents, &hashes_similarity, all_hashed_images, "BEFORE");
|
|
||||||
}
|
|
||||||
|
|
||||||
Some((hashes_parents, hashes_similarity))
|
Some((hashes_parents, hashes_similarity))
|
||||||
}
|
}
|
||||||
|
@ -827,10 +824,7 @@ impl SimilarImages {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(debug_assertions)]
|
debug_check_for_duplicated_things(self.use_reference_folders, &hashes_parents, &hashes_similarity, all_hashed_images, "LATTER");
|
||||||
if !self.use_reference_folders {
|
|
||||||
debug_check_for_duplicated_things(&hashes_parents, &hashes_similarity, all_hashed_images, "LATTER");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Just simple check if all original hashes with multiple entries are available in end results
|
// Just simple check if all original hashes with multiple entries are available in end results
|
||||||
let original_hashes_at_start = hashes_with_multiple_images.len();
|
let original_hashes_at_start = hashes_with_multiple_images.len();
|
||||||
|
@ -982,10 +976,12 @@ impl SimilarImages {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
|
#[allow(unreachable_code)]
|
||||||
|
#[allow(unused_variables)]
|
||||||
pub fn verify_duplicated_items(&self, collected_similar_images: &HashMap<ImHash, Vec<FileEntry>>) {
|
pub fn verify_duplicated_items(&self, collected_similar_images: &HashMap<ImHash, Vec<FileEntry>>) {
|
||||||
|
#[cfg(not(debug_assertions))]
|
||||||
|
return;
|
||||||
// Validating if group contains duplicated results
|
// Validating if group contains duplicated results
|
||||||
#[cfg(debug_assertions)]
|
|
||||||
{
|
|
||||||
let mut result_hashset: HashSet<String> = Default::default();
|
let mut result_hashset: HashSet<String> = Default::default();
|
||||||
let mut found = false;
|
let mut found = false;
|
||||||
for vec_file_entry in collected_similar_images.values() {
|
for vec_file_entry in collected_similar_images.values() {
|
||||||
|
@ -1011,7 +1007,6 @@ impl SimilarImages {
|
||||||
}
|
}
|
||||||
assert!(!found, "Found Invalid entries, verify errors before"); // TODO crashes with empty result with reference folder, verify why
|
assert!(!found, "Found Invalid entries, verify errors before"); // TODO crashes with empty result with reference folder, verify why
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/// Set included dir which needs to be relative, exists etc.
|
/// Set included dir which needs to be relative, exists etc.
|
||||||
pub fn set_included_directory(&mut self, included_directory: Vec<PathBuf>) {
|
pub fn set_included_directory(&mut self, included_directory: Vec<PathBuf>) {
|
||||||
|
@ -1391,15 +1386,25 @@ pub fn test_image_conversion_speed() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
|
#[allow(unreachable_code)]
|
||||||
|
#[allow(unused_variables)]
|
||||||
// Function to validate if after first check there are any duplicated entries
|
// Function to validate if after first check there are any duplicated entries
|
||||||
// E.g. /a.jpg is used also as master and similar image which is forbidden, because may
|
// E.g. /a.jpg is used also as master and similar image which is forbidden, because may
|
||||||
// cause accidentally delete more pictures that user wanted
|
// cause accidentally delete more pictures that user wanted
|
||||||
fn debug_check_for_duplicated_things(
|
fn debug_check_for_duplicated_things(
|
||||||
|
use_reference_folders: bool,
|
||||||
hashes_parents: &HashMap<ImHash, u32>,
|
hashes_parents: &HashMap<ImHash, u32>,
|
||||||
hashes_similarity: &HashMap<ImHash, (ImHash, u32)>,
|
hashes_similarity: &HashMap<ImHash, (ImHash, u32)>,
|
||||||
all_hashed_images: &HashMap<ImHash, Vec<FileEntry>>,
|
all_hashed_images: &HashMap<ImHash, Vec<FileEntry>>,
|
||||||
numm: &str,
|
numm: &str,
|
||||||
) {
|
) {
|
||||||
|
#[cfg(not(debug_assertions))]
|
||||||
|
return;
|
||||||
|
|
||||||
|
if use_reference_folders {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let mut found_broken_thing = false;
|
let mut found_broken_thing = false;
|
||||||
let mut hashmap_hashes: HashSet<_> = Default::default();
|
let mut hashmap_hashes: HashSet<_> = Default::default();
|
||||||
let mut hashmap_names: HashSet<_> = Default::default();
|
let mut hashmap_names: HashSet<_> = Default::default();
|
||||||
|
|
Loading…
Reference in a new issue