mirror of
https://github.com/arsenetar/dupeguru.git
synced 2026-01-22 14:41:39 +00:00
fix: Minor cleanups and fixes
- Update NullJob to subclass Job - Remove unnecessary size pre-read in _getMatches() as file sizes are already loaded during file scan via stat call - Skip ref check if contents scan as the scan already prevents this from happening, some of the other scans do things differently and need to be reviewed before removing this post step completely - Add guard on partial hashing to just hash the whole file if smaller than the offset and size and use the value for both the partial digest and digest
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
# http://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
|
||||
from typing import Any, Callable, Generator, Iterator, List, Union
|
||||
from typing import Any, Callable, Generator, List, Union
|
||||
|
||||
|
||||
class JobCancelled(Exception):
|
||||
@@ -148,7 +148,7 @@ class Job:
|
||||
self._do_update(desc)
|
||||
|
||||
|
||||
class NullJob:
|
||||
class NullJob(Job):
|
||||
def __init__(self, *args, **kwargs) -> None:
|
||||
# Null job does nothing
|
||||
pass
|
||||
@@ -161,9 +161,6 @@ class NullJob:
|
||||
# Null job does nothing
|
||||
pass
|
||||
|
||||
def iter_with_progress(self, sequence, *args, **kwargs) -> Iterator:
|
||||
return iter(sequence)
|
||||
|
||||
def start_job(self, *args, **kwargs) -> None:
|
||||
# Null job does nothing
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user