mirror of
https://github.com/sreedevk/deduplicator.git
synced 2026-09-01 21:15:33 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a6511f2cf3 | ||
|
|
64d0106765 | ||
|
|
c75b2eb1c9 | ||
|
|
b736853dfe | ||
|
|
92290480a8 | ||
|
|
b7f775e04c | ||
|
|
2294471b50 |
3
Cargo.lock
generated
3
Cargo.lock
generated
@@ -316,7 +316,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "deduplicator"
|
name = "deduplicator"
|
||||||
version = "0.0.8"
|
version = "0.0.9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"chrono",
|
"chrono",
|
||||||
@@ -334,6 +334,7 @@ dependencies = [
|
|||||||
"thiserror",
|
"thiserror",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tui",
|
"tui",
|
||||||
|
"unicode-segmentation",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "deduplicator"
|
name = "deduplicator"
|
||||||
version = "0.0.8"
|
version = "0.0.9"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "find,filter,delete Duplicates"
|
description = "find,filter,delete Duplicates"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
@@ -25,3 +25,4 @@ sqlite = "0.30.3"
|
|||||||
thiserror = "1.0.38"
|
thiserror = "1.0.38"
|
||||||
tokio = { version = "1.23.0", features = ["full"] }
|
tokio = { version = "1.23.0", features = ["full"] }
|
||||||
tui = "0.19.0"
|
tui = "0.19.0"
|
||||||
|
unicode-segmentation = "1.10.0"
|
||||||
|
|||||||
15
README.md
15
README.md
@@ -38,16 +38,13 @@ cargo install deduplicator
|
|||||||
<p align="center">
|
<p align="center">
|
||||||
Deduplicator uses fxhash (a non-cryptographic hashing algorithm) which is extremely fast. As a result, deduplicator is able to process huge amounts of data in a couple of seconds.</p>
|
Deduplicator uses fxhash (a non-cryptographic hashing algorithm) which is extremely fast. As a result, deduplicator is able to process huge amounts of data in a couple of seconds.</p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
While testing, Deduplicator was able to go through 8.6GB of pdf files and detect duplicates in 2.9 seconds
|
While testing, Deduplicator was able to go through 8.6GB of pdf files and detect duplicates in 2.9 seconds
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h2 align="center">Screenshots</h2>
|
<h2 align="center">Screenshots</h2>
|
||||||
|
|
||||||
<p align="center>
|
|
||||||
<a href="https://asciinema.org/a/oMzGUSlAx32xYXcPBY64uAuLB" target="_blank"><img src="https://asciinema.org/a/oMzGUSlAx32xYXcPBY64uAuLB.svg" /></a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p align="center">
|
<img src="https://user-images.githubusercontent.com/36154121/211948081-63c12b94-6251-487b-a49f-ac5418169d5a.gif" />
|
||||||
<img align="center" src="https://user-images.githubusercontent.com/36154121/211458077-90092aa3-496c-492f-a061-618059890d5f.png" width="500" height="400" />
|
<img src="https://user-images.githubusercontent.com/36154121/211458077-90092aa3-496c-492f-a061-618059890d5f.png" />
|
||||||
</p>
|
|
||||||
|
|
||||||
|
|||||||
@@ -12,15 +12,20 @@ use crate::app::file_manager;
|
|||||||
use crate::database::File;
|
use crate::database::File;
|
||||||
use crate::params::Params;
|
use crate::params::Params;
|
||||||
use prettytable::{format, row, Cell, Row, Table};
|
use prettytable::{format, row, Cell, Row, Table};
|
||||||
|
use unicode_segmentation::UnicodeSegmentation;
|
||||||
|
|
||||||
fn format_path(path: &str, opts: &Params) -> Result<String> {
|
fn format_path(path: &str, opts: &Params) -> Result<String> {
|
||||||
let display_path = path.replace(&opts.get_directory()?, "");
|
let display_path = path.replace(&opts.get_directory()?, "");
|
||||||
let text_vec = display_path.chars().collect::<Vec<_>>();
|
|
||||||
|
|
||||||
let display_range = if text_vec.len() > 32 {
|
let display_range = if display_path.chars().count() > 32 {
|
||||||
text_vec[(display_path.len() - 32)..]
|
display_path
|
||||||
.iter()
|
.graphemes(true)
|
||||||
.collect::<String>()
|
.collect::<Vec<&str>>()
|
||||||
|
.into_iter()
|
||||||
|
.rev()
|
||||||
|
.take(32)
|
||||||
|
.rev()
|
||||||
|
.collect()
|
||||||
} else {
|
} else {
|
||||||
display_path
|
display_path
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user