Add maximum file size (#407)
* Add maximum file size * Add maximum file size
This commit is contained in:
parent
909967dcd8
commit
a92a113714
|
@ -60,25 +60,25 @@ jobs:
|
|||
python3 misc/check_results.py TestSuite 15 8
|
||||
|
||||
|
||||
target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -D aen
|
||||
target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -D aen -m 1024
|
||||
python3 misc/check_results.py TestSuite 7 8
|
||||
|
||||
rm -rf TestSuite
|
||||
unzip TestSuite.zip -d TestSuite
|
||||
|
||||
target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -D aen
|
||||
target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -D aen -m 1024
|
||||
python3 misc/check_results.py TestSuite 7 8
|
||||
|
||||
rm -rf TestSuite
|
||||
unzip TestSuite.zip -d TestSuite
|
||||
|
||||
target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -x TEXT -D aeo
|
||||
target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -x TEXT -D aeo -m 1024
|
||||
python3 misc/check_results.py TestSuite 14 8
|
||||
|
||||
rm -rf TestSuite
|
||||
unzip TestSuite.zip -d TestSuite
|
||||
|
||||
target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -e "$(pwd)/TestSuite/SubFolder" -D aeo
|
||||
target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -e "$(pwd)/TestSuite/SubFolder" -D aeo -m 1024
|
||||
python3 misc/check_results.py TestSuite 13 8
|
||||
|
||||
rm -rf TestSuite
|
||||
|
@ -90,9 +90,9 @@ jobs:
|
|||
rm -rf TestSuite
|
||||
unzip TestSuite.zip -d TestSuite
|
||||
|
||||
target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -R
|
||||
target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -R -m 1024
|
||||
python3 misc/check_results.py TestSuite 15 8
|
||||
target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -R -D aeo
|
||||
target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -R -D aeo -m 1024
|
||||
python3 misc/check_results.py TestSuite 13 8
|
||||
|
||||
|
||||
|
|
|
@ -60,19 +60,19 @@ jobs:
|
|||
python misc/check_results.py TestSuite 15 8
|
||||
|
||||
|
||||
target/release/czkawka_cli dup -d "$(pwd)/TestSuite" "$(pwd)\testsuite" -e "$(pwd)/TestSuite/subFolder" -D aeo
|
||||
target/release/czkawka_cli dup -d "$(pwd)/TestSuite" "$(pwd)\testsuite" -e "$(pwd)/TestSuite/subFolder" -D aeo -m 1024
|
||||
python misc/check_results.py TestSuite 13 8
|
||||
|
||||
rm -r TestSuite
|
||||
unzip TestSuite.zip -d TestSuite
|
||||
|
||||
target/release/czkawka_cli dup -d "$(pwd)/TestSuite" "$(pwd)/teStSuite" -D aen
|
||||
target/release/czkawka_cli dup -d "$(pwd)/TestSuite" "$(pwd)/teStSuite" -D aen -m 1024
|
||||
python misc/check_results.py TestSuite 7 8
|
||||
|
||||
rm -r TestSuite
|
||||
unzip TestSuite.zip -d TestSuite
|
||||
|
||||
target/release/czkawka_cli dup -d "$(pwd)\TestSuite" "$(pwd)/TESTSUITE" -D aen
|
||||
target/release/czkawka_cli dup -d "$(pwd)\TestSuite" "$(pwd)/TESTSUITE" -D aen -m 1024
|
||||
python misc/check_results.py TestSuite 7 8
|
||||
|
||||
rm -r TestSuite
|
||||
|
@ -81,25 +81,25 @@ jobs:
|
|||
|
||||
|
||||
|
||||
target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -D aen
|
||||
target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -D aen -m 1024
|
||||
python misc/check_results.py TestSuite 7 8
|
||||
|
||||
rm -r TestSuite
|
||||
unzip TestSuite.zip -d TestSuite
|
||||
|
||||
target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -D aen
|
||||
target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -D aen -m 1024
|
||||
python misc/check_results.py TestSuite 7 8
|
||||
|
||||
rm -r TestSuite
|
||||
unzip TestSuite.zip -d TestSuite
|
||||
|
||||
target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -x TEXT -D aeo
|
||||
target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -x TEXT -D aeo -m 1024
|
||||
python misc/check_results.py TestSuite 14 8
|
||||
|
||||
rm -r TestSuite
|
||||
unzip TestSuite.zip -d TestSuite
|
||||
|
||||
target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -e "$(pwd)/TestSuite/SubFolder" -D aeo
|
||||
target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -e "$(pwd)/TestSuite/SubFolder" -D aeo -m 1024
|
||||
python misc/check_results.py TestSuite 13 8
|
||||
|
||||
rm -r TestSuite
|
||||
|
@ -111,9 +111,9 @@ jobs:
|
|||
rm -r TestSuite
|
||||
unzip TestSuite.zip -d TestSuite
|
||||
|
||||
target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -R
|
||||
target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -R -m 1024
|
||||
python misc/check_results.py TestSuite 15 8
|
||||
target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -R -D aeo
|
||||
target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -R -D aeo -m 1024
|
||||
python misc/check_results.py TestSuite 13 8
|
||||
|
||||
|
||||
|
|
|
@ -15,8 +15,10 @@ pub enum Commands {
|
|||
excluded_directories: ExcludedDirectories,
|
||||
#[structopt(flatten)]
|
||||
excluded_items: ExcludedItems,
|
||||
#[structopt(short, long, parse(try_from_str = parse_minimal_file_size), default_value = "1024", help = "Minimum size in bytes", long_help = "Minimum size of checked files in bytes, assigning bigger value may speed up searching")]
|
||||
#[structopt(short, long, parse(try_from_str = parse_minimal_file_size), default_value = "8192", help = "Minimum size in bytes", long_help = "Minimum size of checked files in bytes, assigning bigger value may speed up searching")]
|
||||
minimal_file_size: u64,
|
||||
#[structopt(short = "i", long, parse(try_from_str = parse_maximal_file_size), default_value = "18446744073709551615", help = "Maximum size in bytes", long_help = "Maximum size of checked files in bytes, assigning lower value may speed up searching")]
|
||||
maximal_file_size: u64,
|
||||
#[structopt(short = "c", long, parse(try_from_str = parse_minimal_file_size), default_value = "2097152", help = "Minimum cached file size in bytes", long_help = "Minimum size of cached files in bytes, assigning bigger value may speed up will cause that lower amount of files will be cached, but loading of cache will be faster")]
|
||||
minimal_cached_file_size: u64,
|
||||
#[structopt(flatten)]
|
||||
|
@ -109,6 +111,8 @@ pub enum Commands {
|
|||
excluded_directories: ExcludedDirectories,
|
||||
#[structopt(short, long, parse(try_from_str = parse_minimal_file_size), default_value = "16384", help = "Minimum size in bytes", long_help = "Minimum size of checked files in bytes, assigning bigger value may speed up searching")]
|
||||
minimal_file_size: u64,
|
||||
#[structopt(short = "i", long, parse(try_from_str = parse_maximal_file_size), default_value = "18446744073709551615", help = "Maximum size in bytes", long_help = "Maximum size of checked files in bytes, assigning lower value may speed up searching")]
|
||||
maximal_file_size: u64,
|
||||
#[structopt(short, long, default_value = "High", parse(try_from_str = parse_similar_images_similarity), help = "Similairty level (Minimal, VerySmall, Small, Medium, High, VeryHigh)", long_help = "Methods to choose similarity level of images which will be considered as duplicated.")]
|
||||
similarity: Similarity,
|
||||
#[structopt(flatten)]
|
||||
|
@ -134,8 +138,10 @@ pub enum Commands {
|
|||
file_to_save: FileToSave,
|
||||
#[structopt(flatten)]
|
||||
not_recursive: NotRecursive,
|
||||
#[structopt(short, long, parse(try_from_str = parse_minimal_file_size), default_value = "1024", help = "Minimum size in bytes", long_help = "Minimum size of checked files in bytes, assigning bigger value may speed up searching")]
|
||||
#[structopt(short, long, parse(try_from_str = parse_minimal_file_size), default_value = "8192", help = "Minimum size in bytes", long_help = "Minimum size of checked files in bytes, assigning bigger value may speed up searching")]
|
||||
minimal_file_size: u64,
|
||||
#[structopt(short = "i", long, parse(try_from_str = parse_maximal_file_size), default_value = "18446744073709551615", help = "Maximum size in bytes", long_help = "Maximum size of checked files in bytes, assigning lower value may speed up searching")]
|
||||
maximal_file_size: u64,
|
||||
},
|
||||
#[structopt(name = "music", about = "Finds same music by tags", help_message = HELP_MESSAGE, after_help = "EXAMPLE:\n czkawka music -d /home/rafal -f results.txt")]
|
||||
SameMusic {
|
||||
|
@ -153,8 +159,10 @@ pub enum Commands {
|
|||
file_to_save: FileToSave,
|
||||
#[structopt(flatten)]
|
||||
not_recursive: NotRecursive,
|
||||
#[structopt(short, long, parse(try_from_str = parse_minimal_file_size), default_value = "1024", help = "Minimum size in bytes", long_help = "Minimum size of checked files in bytes, assigning bigger value may speed up searching")]
|
||||
#[structopt(short, long, parse(try_from_str = parse_minimal_file_size), default_value = "8192", help = "Minimum size in bytes", long_help = "Minimum size of checked files in bytes, assigning bigger value may speed up searching")]
|
||||
minimal_file_size: u64,
|
||||
#[structopt(short = "i", long, parse(try_from_str = parse_maximal_file_size), default_value = "18446744073709551615", help = "Maximum size in bytes", long_help = "Maximum size of checked files in bytes, assigning lower value may speed up searching")]
|
||||
maximal_file_size: u64,
|
||||
},
|
||||
#[structopt(name = "symlinks", about = "Finds invalid symlinks", help_message = HELP_MESSAGE, after_help = "EXAMPLE:\n czkawka symlinks -d /home/kicikici/ /home/szczek -e /home/kicikici/jestempsem -x jpg -f results.txt")]
|
||||
InvalidSymlinks {
|
||||
|
@ -312,6 +320,13 @@ fn parse_minimal_file_size(src: &str) -> Result<u64, String> {
|
|||
}
|
||||
}
|
||||
|
||||
fn parse_maximal_file_size(src: &str) -> Result<u64, String> {
|
||||
match src.parse::<u64>() {
|
||||
Ok(maximal_file_size) => Ok(maximal_file_size),
|
||||
Err(e) => Err(e.to_string()),
|
||||
}
|
||||
}
|
||||
|
||||
fn parse_music_duplicate_type(src: &str) -> Result<MusicSimilarity, String> {
|
||||
if src.is_empty() {
|
||||
return Ok(MusicSimilarity::NONE);
|
||||
|
|
|
@ -33,6 +33,7 @@ fn main() {
|
|||
excluded_directories,
|
||||
excluded_items,
|
||||
minimal_file_size,
|
||||
maximal_file_size,
|
||||
minimal_cached_file_size,
|
||||
allowed_extensions,
|
||||
search_method,
|
||||
|
@ -49,6 +50,7 @@ fn main() {
|
|||
df.set_excluded_directory(excluded_directories.excluded_directories);
|
||||
df.set_excluded_items(excluded_items.excluded_items);
|
||||
df.set_minimal_file_size(minimal_file_size);
|
||||
df.set_maximal_file_size(maximal_file_size);
|
||||
df.set_minimal_cache_file_size(minimal_cached_file_size);
|
||||
df.set_allowed_extensions(allowed_extensions.allowed_extensions.join(","));
|
||||
df.set_check_method(search_method);
|
||||
|
@ -205,6 +207,7 @@ fn main() {
|
|||
excluded_items,
|
||||
file_to_save,
|
||||
minimal_file_size,
|
||||
maximal_file_size,
|
||||
similarity,
|
||||
not_recursive,
|
||||
} => {
|
||||
|
@ -214,6 +217,7 @@ fn main() {
|
|||
sf.set_excluded_directory(excluded_directories.excluded_directories);
|
||||
sf.set_excluded_items(excluded_items.excluded_items);
|
||||
sf.set_minimal_file_size(minimal_file_size);
|
||||
sf.set_maximal_file_size(maximal_file_size);
|
||||
sf.set_recursive_search(!not_recursive.not_recursive);
|
||||
sf.set_similarity(similarity);
|
||||
|
||||
|
@ -239,6 +243,7 @@ fn main() {
|
|||
file_to_save,
|
||||
not_recursive,
|
||||
minimal_file_size,
|
||||
maximal_file_size,
|
||||
} => {
|
||||
let mut zf = ZeroedFiles::new();
|
||||
|
||||
|
@ -247,6 +252,7 @@ fn main() {
|
|||
zf.set_excluded_items(excluded_items.excluded_items);
|
||||
zf.set_allowed_extensions(allowed_extensions.allowed_extensions.join(","));
|
||||
zf.set_minimal_file_size(minimal_file_size);
|
||||
zf.set_maximal_file_size(maximal_file_size);
|
||||
zf.set_recursive_search(!not_recursive.not_recursive);
|
||||
|
||||
if delete_files {
|
||||
|
@ -274,6 +280,7 @@ fn main() {
|
|||
file_to_save,
|
||||
not_recursive,
|
||||
minimal_file_size,
|
||||
maximal_file_size,
|
||||
music_similarity,
|
||||
} => {
|
||||
let mut mf = SameMusic::new();
|
||||
|
@ -282,6 +289,7 @@ fn main() {
|
|||
mf.set_excluded_directory(excluded_directories.excluded_directories);
|
||||
mf.set_excluded_items(excluded_items.excluded_items);
|
||||
mf.set_minimal_file_size(minimal_file_size);
|
||||
mf.set_maximal_file_size(maximal_file_size);
|
||||
mf.set_recursive_search(!not_recursive.not_recursive);
|
||||
mf.set_music_similarity(music_similarity);
|
||||
|
||||
|
|
|
@ -145,6 +145,7 @@ pub struct DuplicateFinder {
|
|||
excluded_items: ExcludedItems,
|
||||
recursive_search: bool,
|
||||
minimal_file_size: u64,
|
||||
maximal_file_size: u64,
|
||||
check_method: CheckingMethod,
|
||||
delete_method: DeleteMethod,
|
||||
hash_type: HashType,
|
||||
|
@ -167,7 +168,8 @@ impl DuplicateFinder {
|
|||
allowed_extensions: Extensions::new(),
|
||||
check_method: CheckingMethod::None,
|
||||
delete_method: DeleteMethod::None,
|
||||
minimal_file_size: 1024,
|
||||
minimal_file_size: 8192,
|
||||
maximal_file_size: u64::MAX,
|
||||
directories: Directories::new(),
|
||||
excluded_items: ExcludedItems::new(),
|
||||
stopped_search: false,
|
||||
|
@ -240,6 +242,12 @@ impl DuplicateFinder {
|
|||
pub const fn get_files_sorted_by_hash(&self) -> &BTreeMap<u64, Vec<Vec<FileEntry>>> {
|
||||
&self.files_with_identical_hashes
|
||||
}
|
||||
pub fn set_maximal_file_size(&mut self, maximal_file_size: u64) {
|
||||
self.maximal_file_size = match maximal_file_size {
|
||||
0 => 1,
|
||||
t => t,
|
||||
};
|
||||
}
|
||||
|
||||
pub const fn get_text_messages(&self) -> &Messages {
|
||||
&self.text_messages
|
||||
|
@ -404,7 +412,7 @@ impl DuplicateFinder {
|
|||
}
|
||||
}
|
||||
// Checking files
|
||||
if metadata.len() >= self.minimal_file_size {
|
||||
if (self.minimal_file_size..=self.maximal_file_size).contains(&metadata.len()) {
|
||||
let current_file_name = current_folder.join(entry_data.file_name());
|
||||
if self.excluded_items.is_excluded(¤t_file_name) {
|
||||
continue 'dir;
|
||||
|
@ -576,7 +584,7 @@ impl DuplicateFinder {
|
|||
}
|
||||
}
|
||||
// Checking files
|
||||
if metadata.len() >= self.minimal_file_size {
|
||||
if (self.minimal_file_size..=self.maximal_file_size).contains(&metadata.len()) {
|
||||
let current_file_name = current_folder.join(entry_data.file_name());
|
||||
if self.excluded_items.is_excluded(¤t_file_name) {
|
||||
continue 'dir;
|
||||
|
|
|
@ -88,6 +88,7 @@ pub struct SameMusic {
|
|||
directories: Directories,
|
||||
excluded_items: ExcludedItems,
|
||||
minimal_file_size: u64,
|
||||
maximal_file_size: u64,
|
||||
recursive_search: bool,
|
||||
delete_method: DeleteMethod,
|
||||
music_similarity: MusicSimilarity,
|
||||
|
@ -106,7 +107,8 @@ impl SameMusic {
|
|||
delete_method: DeleteMethod::None,
|
||||
music_similarity: MusicSimilarity::NONE,
|
||||
stopped_search: false,
|
||||
minimal_file_size: 1024,
|
||||
minimal_file_size: 8192,
|
||||
maximal_file_size: u64::MAX,
|
||||
duplicated_music_entries: vec![],
|
||||
music_to_check: Vec::with_capacity(2048),
|
||||
}
|
||||
|
@ -173,6 +175,13 @@ impl SameMusic {
|
|||
self.music_similarity = music_similarity;
|
||||
}
|
||||
|
||||
pub fn set_maximal_file_size(&mut self, maximal_file_size: u64) {
|
||||
self.maximal_file_size = match maximal_file_size {
|
||||
0 => 1,
|
||||
t => t,
|
||||
};
|
||||
}
|
||||
|
||||
/// Check files for any with size == 0
|
||||
fn check_files(&mut self, stop_receiver: Option<&Receiver<()>>, progress_sender: Option<&futures::channel::mpsc::UnboundedSender<ProgressData>>) -> bool {
|
||||
let start_time: SystemTime = SystemTime::now();
|
||||
|
@ -260,7 +269,7 @@ impl SameMusic {
|
|||
} else if metadata.is_file() {
|
||||
atomic_file_counter.fetch_add(1, Ordering::Relaxed);
|
||||
// Checking files
|
||||
if metadata.len() >= self.minimal_file_size {
|
||||
if (self.minimal_file_size..=self.maximal_file_size).contains(&metadata.len()) {
|
||||
let current_file_name = current_folder.join(entry_data.file_name());
|
||||
if self.excluded_items.is_excluded(¤t_file_name) {
|
||||
continue 'dir;
|
||||
|
|
|
@ -76,6 +76,7 @@ pub struct SimilarImages {
|
|||
similar_vectors: Vec<Vec<FileEntry>>,
|
||||
recursive_search: bool,
|
||||
minimal_file_size: u64,
|
||||
maximal_file_size: u64,
|
||||
image_hashes: BTreeMap<Node, Vec<FileEntry>>, // Hashmap with image hashes and Vector with names of files
|
||||
stopped_search: bool,
|
||||
similarity: Similarity,
|
||||
|
@ -109,6 +110,7 @@ impl SimilarImages {
|
|||
similar_vectors: vec![],
|
||||
recursive_search: true,
|
||||
minimal_file_size: 1024 * 16, // 16 KB should be enough to exclude too small images from search
|
||||
maximal_file_size: u64::MAX,
|
||||
image_hashes: Default::default(),
|
||||
stopped_search: false,
|
||||
similarity: Similarity::Similar(1),
|
||||
|
@ -147,6 +149,12 @@ impl SimilarImages {
|
|||
t => t,
|
||||
};
|
||||
}
|
||||
pub fn set_maximal_file_size(&mut self, maximal_file_size: u64) {
|
||||
self.maximal_file_size = match maximal_file_size {
|
||||
0 => 1,
|
||||
t => t,
|
||||
};
|
||||
}
|
||||
pub fn set_similarity(&mut self, similarity: Similarity) {
|
||||
self.similarity = similarity;
|
||||
}
|
||||
|
@ -278,7 +286,7 @@ impl SimilarImages {
|
|||
}
|
||||
|
||||
// Checking files
|
||||
if metadata.len() >= self.minimal_file_size {
|
||||
if (self.minimal_file_size..=self.maximal_file_size).contains(&metadata.len()) {
|
||||
let current_file_name = current_folder.join(entry_data.file_name());
|
||||
if self.excluded_items.is_excluded(¤t_file_name) {
|
||||
continue 'dir;
|
||||
|
|
|
@ -63,6 +63,7 @@ pub struct ZeroedFiles {
|
|||
delete_method: DeleteMethod,
|
||||
stopped_search: bool,
|
||||
minimal_file_size: u64,
|
||||
maximal_file_size: u64,
|
||||
files_to_check: Vec<FileEntry>,
|
||||
}
|
||||
|
||||
|
@ -78,7 +79,8 @@ impl ZeroedFiles {
|
|||
zeroed_files: vec![],
|
||||
delete_method: DeleteMethod::None,
|
||||
stopped_search: false,
|
||||
minimal_file_size: 1024,
|
||||
minimal_file_size: 8192,
|
||||
maximal_file_size: u64::MAX,
|
||||
files_to_check: Vec::with_capacity(1024),
|
||||
}
|
||||
}
|
||||
|
@ -123,6 +125,12 @@ impl ZeroedFiles {
|
|||
t => t,
|
||||
};
|
||||
}
|
||||
pub fn set_maximal_file_size(&mut self, maximal_file_size: u64) {
|
||||
self.maximal_file_size = match maximal_file_size {
|
||||
0 => 1,
|
||||
t => t,
|
||||
};
|
||||
}
|
||||
|
||||
pub fn set_recursive_search(&mut self, recursive_search: bool) {
|
||||
self.recursive_search = recursive_search;
|
||||
|
@ -229,7 +237,7 @@ impl ZeroedFiles {
|
|||
folders_to_check.push(next_folder);
|
||||
} else if metadata.is_file() {
|
||||
atomic_file_counter.fetch_add(1, Ordering::Relaxed);
|
||||
if metadata.len() == 0 || metadata.len() < self.minimal_file_size {
|
||||
if metadata.len() == 0 || !(self.minimal_file_size..=self.maximal_file_size).contains(&metadata.len()) {
|
||||
continue 'dir;
|
||||
}
|
||||
|
||||
|
|
|
@ -47,6 +47,7 @@ pub fn connect_button_search(
|
|||
let check_button_recursive = gui_data.upper_notebook.check_button_recursive.clone();
|
||||
let entry_excluded_items = gui_data.upper_notebook.entry_excluded_items.clone();
|
||||
let entry_same_music_minimal_size = gui_data.main_notebook.entry_same_music_minimal_size.clone();
|
||||
let entry_same_music_maximal_size = gui_data.main_notebook.entry_same_music_maximal_size.clone();
|
||||
let entry_allowed_extensions = gui_data.upper_notebook.entry_allowed_extensions.clone();
|
||||
let buttons_names = gui_data.bottom_buttons.buttons_names.clone();
|
||||
let radio_button_duplicates_name = gui_data.main_notebook.radio_button_duplicates_name.clone();
|
||||
|
@ -55,9 +56,11 @@ pub fn connect_button_search(
|
|||
let radio_button_duplicates_hash = gui_data.main_notebook.radio_button_duplicates_hash.clone();
|
||||
let scale_similarity = gui_data.main_notebook.scale_similarity.clone();
|
||||
let entry_duplicate_minimal_size = gui_data.main_notebook.entry_duplicate_minimal_size.clone();
|
||||
let entry_duplicate_maximal_size = gui_data.main_notebook.entry_duplicate_maximal_size.clone();
|
||||
let stop_receiver = gui_data.stop_receiver.clone();
|
||||
let entry_big_files_number = gui_data.main_notebook.entry_big_files_number.clone();
|
||||
let entry_similar_images_minimal_size = gui_data.main_notebook.entry_similar_images_minimal_size.clone();
|
||||
let entry_similar_images_maximal_size = gui_data.main_notebook.entry_similar_images_maximal_size.clone();
|
||||
let check_button_music_title: gtk::CheckButton = gui_data.main_notebook.check_button_music_title.clone();
|
||||
let check_button_music_artist: gtk::CheckButton = gui_data.main_notebook.check_button_music_artist.clone();
|
||||
let check_button_music_album_title: gtk::CheckButton = gui_data.main_notebook.check_button_music_album_title.clone();
|
||||
|
@ -140,7 +143,8 @@ pub fn connect_button_search(
|
|||
} else {
|
||||
panic!("No radio button is pressed");
|
||||
}
|
||||
let minimal_file_size = entry_duplicate_minimal_size.text().as_str().parse::<u64>().unwrap_or(1024);
|
||||
let minimal_file_size = entry_duplicate_minimal_size.text().as_str().parse::<u64>().unwrap_or(1024 * 8);
|
||||
let maximal_file_size = entry_duplicate_maximal_size.text().as_str().parse::<u64>().unwrap_or(1024 * 1024 * 1024 * 1024);
|
||||
|
||||
let hash_type: HashType;
|
||||
if radio_button_hash_type_blake3.is_active() {
|
||||
|
@ -163,6 +167,7 @@ pub fn connect_button_search(
|
|||
df.set_excluded_items(excluded_items);
|
||||
df.set_allowed_extensions(allowed_extensions);
|
||||
df.set_minimal_file_size(minimal_file_size);
|
||||
df.set_maximal_file_size(maximal_file_size);
|
||||
df.set_minimal_cache_file_size(minimal_cache_file_size);
|
||||
df.set_check_method(check_method);
|
||||
df.set_hash_type(hash_type);
|
||||
|
@ -264,6 +269,7 @@ pub fn connect_button_search(
|
|||
get_list_store(&tree_view_similar_images_finder).clear();
|
||||
|
||||
let minimal_file_size = entry_similar_images_minimal_size.text().as_str().parse::<u64>().unwrap_or(1024 * 16);
|
||||
let maximal_file_size = entry_similar_images_maximal_size.text().as_str().parse::<u64>().unwrap_or(1024 * 1024 * 1024 * 1024);
|
||||
|
||||
let similarity = similar_images::Similarity::Similar(scale_similarity.value() as u32);
|
||||
|
||||
|
@ -277,6 +283,7 @@ pub fn connect_button_search(
|
|||
sf.set_recursive_search(recursive_search);
|
||||
sf.set_excluded_items(excluded_items);
|
||||
sf.set_minimal_file_size(minimal_file_size);
|
||||
sf.set_maximal_file_size(maximal_file_size);
|
||||
sf.set_similarity(similarity);
|
||||
sf.set_use_cache(use_cache);
|
||||
sf.find_similar_images(Some(&stop_receiver), Some(&futures_sender_similar_images));
|
||||
|
@ -311,7 +318,8 @@ pub fn connect_button_search(
|
|||
|
||||
get_list_store(&tree_view_same_music_finder).clear();
|
||||
|
||||
let minimal_file_size = entry_same_music_minimal_size.text().as_str().parse::<u64>().unwrap_or(1024);
|
||||
let minimal_file_size = entry_same_music_minimal_size.text().as_str().parse::<u64>().unwrap_or(1024 * 8);
|
||||
let maximal_file_size = entry_same_music_maximal_size.text().as_str().parse::<u64>().unwrap_or(1024 * 1024 * 1024 * 1024);
|
||||
|
||||
let mut music_similarity: MusicSimilarity = MusicSimilarity::NONE;
|
||||
|
||||
|
@ -341,6 +349,7 @@ pub fn connect_button_search(
|
|||
mf.set_excluded_directory(excluded_directories);
|
||||
mf.set_excluded_items(excluded_items);
|
||||
mf.set_minimal_file_size(minimal_file_size);
|
||||
mf.set_maximal_file_size(maximal_file_size);
|
||||
mf.set_recursive_search(recursive_search);
|
||||
mf.set_music_similarity(music_similarity);
|
||||
mf.find_same_music(Some(&stop_receiver), Some(&futures_sender_same_music));
|
||||
|
|
|
@ -28,9 +28,13 @@ pub struct GuiMainNotebook {
|
|||
pub tree_view_broken_files: gtk::TreeView,
|
||||
|
||||
pub entry_similar_images_minimal_size: gtk::Entry,
|
||||
pub entry_similar_images_maximal_size: gtk::Entry,
|
||||
pub entry_duplicate_minimal_size: gtk::Entry,
|
||||
pub entry_big_files_number: gtk::Entry,
|
||||
pub entry_duplicate_maximal_size: gtk::Entry,
|
||||
pub entry_same_music_minimal_size: gtk::Entry,
|
||||
pub entry_same_music_maximal_size: gtk::Entry,
|
||||
|
||||
pub entry_big_files_number: gtk::Entry,
|
||||
|
||||
//// Check Buttons
|
||||
pub check_button_music_title: gtk::CheckButton,
|
||||
|
@ -82,9 +86,13 @@ impl GuiMainNotebook {
|
|||
let tree_view_broken_files: gtk::TreeView = TreeView::new();
|
||||
|
||||
let entry_similar_images_minimal_size: gtk::Entry = builder.object("entry_similar_images_minimal_size").unwrap();
|
||||
let entry_similar_images_maximal_size: gtk::Entry = builder.object("entry_similar_images_maximal_size").unwrap();
|
||||
let entry_duplicate_minimal_size: gtk::Entry = builder.object("entry_duplicate_minimal_size").unwrap();
|
||||
let entry_big_files_number: gtk::Entry = builder.object("entry_big_files_number").unwrap();
|
||||
let entry_duplicate_maximal_size: gtk::Entry = builder.object("entry_duplicate_maximal_size").unwrap();
|
||||
let entry_same_music_minimal_size: gtk::Entry = builder.object("entry_same_music_minimal_size").unwrap();
|
||||
let entry_same_music_maximal_size: gtk::Entry = builder.object("entry_same_music_maximal_size").unwrap();
|
||||
|
||||
let entry_big_files_number: gtk::Entry = builder.object("entry_big_files_number").unwrap();
|
||||
|
||||
//// Check Buttons
|
||||
let check_button_music_title: gtk::CheckButton = builder.object("check_button_music_title").unwrap();
|
||||
|
@ -130,6 +138,7 @@ impl GuiMainNotebook {
|
|||
tree_view_invalid_symlinks,
|
||||
tree_view_broken_files,
|
||||
entry_similar_images_minimal_size,
|
||||
entry_similar_images_maximal_size,
|
||||
entry_duplicate_minimal_size,
|
||||
entry_big_files_number,
|
||||
entry_same_music_minimal_size,
|
||||
|
@ -147,6 +156,8 @@ impl GuiMainNotebook {
|
|||
radio_button_hash_type_crc32,
|
||||
radio_button_hash_type_xxh3,
|
||||
image_preview_similar_images,
|
||||
entry_duplicate_maximal_size,
|
||||
entry_same_music_maximal_size,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -658,7 +658,7 @@ Author: Rafał Mikrut
|
|||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Minimum file size(in bytes)</property>
|
||||
<property name="label" translatable="yes">Size(bytes)</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
|
@ -666,19 +666,58 @@ Author: Rafał Mikrut
|
|||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Min:</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="entry_duplicate_minimal_size">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="max-length">15</property>
|
||||
<property name="text" translatable="yes">1024</property>
|
||||
<property name="text" translatable="yes">8192</property>
|
||||
<property name="caps-lock-warning">False</property>
|
||||
<property name="input-purpose">number</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Max:</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="entry_duplicate_maximal_size">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="max-length">15</property>
|
||||
<property name="text" translatable="yes">1099512000000</property>
|
||||
<property name="caps-lock-warning">False</property>
|
||||
<property name="input-purpose">number</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
|
@ -1033,7 +1072,7 @@ Author: Rafał Mikrut
|
|||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Minimum file size(in bytes)</property>
|
||||
<property name="label" translatable="yes">Size(bytes)</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
|
@ -1041,6 +1080,18 @@ Author: Rafał Mikrut
|
|||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Min:</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="entry_similar_images_minimal_size">
|
||||
<property name="visible">True</property>
|
||||
|
@ -1053,7 +1104,34 @@ Author: Rafał Mikrut
|
|||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Max:</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="entry_similar_images_maximal_size">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="max-length">15</property>
|
||||
<property name="text" translatable="yes">1099512000000</property>
|
||||
<property name="caps-lock-warning">False</property>
|
||||
<property name="input-purpose">number</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
|
@ -1191,7 +1269,7 @@ Author: Rafał Mikrut
|
|||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Minimum file size (in bytes)</property>
|
||||
<property name="label" translatable="yes">Size(bytes)</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
|
@ -1199,19 +1277,58 @@ Author: Rafał Mikrut
|
|||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Min:</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="entry_same_music_minimal_size">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="max-length">15</property>
|
||||
<property name="text" translatable="yes">1024</property>
|
||||
<property name="text" translatable="yes">8192</property>
|
||||
<property name="caps-lock-warning">False</property>
|
||||
<property name="input-purpose">number</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Max:</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="entry_same_music_maximal_size">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="max-length">15</property>
|
||||
<property name="text" translatable="yes">1099512000000</property>
|
||||
<property name="caps-lock-warning">False</property>
|
||||
<property name="input-purpose">number</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
|
@ -1341,45 +1458,6 @@ Author: Rafał Mikrut
|
|||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="spacing">8</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Minimum file size (in bytes)</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="entry_zeroed_files_minimal_size">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="max-length">15</property>
|
||||
<property name="text" translatable="yes">1024</property>
|
||||
<property name="caps-lock-warning">False</property>
|
||||
<property name="input-purpose">number</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="scrolled_window_zeroed_files_finder">
|
||||
<property name="visible">True</property>
|
||||
|
|
Loading…
Reference in New Issue