Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
e3rd committed Nov 6, 2024
1 parent 3c4ea14 commit 52bf351
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export TAG := `grep version pyproject.toml | pz --search '"(\d+\.\d+\.\d+(?:rc\d+)?)?"'`

release:
git tag $(TAG)
git push origin $(TAG)
#mkdocs gh-deploy
10 changes: 5 additions & 5 deletions deduplidog/deduplidog.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,8 @@ def check(self):
self.checksum and ("crc32", "") or ("", "crc32")))
print(f"Find files by {used}{f', ignoring: {ignored}' if ignored else ''}")

dirs_ = "" if self.same_superdir else f" at '{
self.work_dir_name}' or the original dir at '{self.original_dir_name}'"
dirs_ = "" if self.same_superdir else \
f" at '{self.work_dir_name}' or the original dir at '{self.original_dir_name}'"
which = f"either the file from the work dir{dirs_} (whichever is bigger)" \
if self.treat_bigger_as_original \
else f"duplicates from the work dir at '{self.work_dir_name}'"
Expand Down Expand Up @@ -626,9 +626,9 @@ def _find_similar(self, work_file: Path, candidates: list[Path]):
for original in candidates:
ost, wst = original.stat(), work_file.stat()
if (self.ignore_date
or wst.st_mtime == ost.st_mtime
or self.tolerate_hour and self.tolerate_hour[0] <= (wst.st_mtime - ost.st_mtime)/3600 <= self.tolerate_hour[1]
) and (self.ignore_size or wst.st_size == ost.st_size and (not self.checksum or crc(original) == crc(work_file))):
or wst.st_mtime == ost.st_mtime
or self.tolerate_hour and self.tolerate_hour[0] <= (wst.st_mtime - ost.st_mtime)/3600 <= self.tolerate_hour[1]
) and (self.ignore_size or wst.st_size == ost.st_size and (not self.checksum or crc(original) == crc(work_file))):
return original

def _find_similar_media(self, work_file: Path, comparing_image: bool, candidates: list[Path]):
Expand Down

0 comments on commit 52bf351

Please sign in to comment.