Fix bugs across all crates
This commit is contained in:
@@ -120,6 +120,11 @@ impl ConvertConfig {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns true if this conversion will change at least some file extensions.
|
||||
pub fn changes_extension(&self) -> bool {
|
||||
!matches!(self, Self::KeepOriginal)
|
||||
}
|
||||
}
|
||||
|
||||
// --- Compress ---
|
||||
@@ -318,6 +323,18 @@ pub struct RenameConfig {
|
||||
fn default_counter_position() -> u32 { 3 }
|
||||
|
||||
impl RenameConfig {
|
||||
/// Returns true if this rename config would actually change any filename.
|
||||
pub fn changes_filename(&self) -> bool {
|
||||
!self.prefix.is_empty()
|
||||
|| !self.suffix.is_empty()
|
||||
|| self.counter_enabled
|
||||
|| !self.regex_find.is_empty()
|
||||
|| self.case_mode > 0
|
||||
|| self.replace_spaces > 0
|
||||
|| self.special_chars > 0
|
||||
|| self.template.is_some()
|
||||
}
|
||||
|
||||
/// Pre-compile the regex for batch use. Call once before a loop of apply_simple_compiled.
|
||||
pub fn compile_regex(&self) -> Option<regex::Regex> {
|
||||
rename::compile_rename_regex(&self.regex_find)
|
||||
|
||||
Reference in New Issue
Block a user