1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2025-05-07 17:29:50 +00:00

Compare commits

..

No commits in common. "1f1dfa88dc5f6ffe13f4de514c884ab9c83bd7ce" and "97f490b8b7e95bac91e68dacdf723597006ed2ec" have entirely different histories.

4 changed files with 45 additions and 51 deletions

View File

@ -1,2 +1,2 @@
__version__ = "4.3.1"
__version__ = "4.3.1-dev"
__appname__ = "dupeGuru"

View File

@ -144,17 +144,13 @@ class FilesDB:
stat = path.stat()
size = stat.st_size
mtime_ns = stat.st_mtime_ns
try:
with self.lock:
self.cur.execute(
self.select_query.format(key=key), {"path": str(path), "size": size, "mtime_ns": mtime_ns}
)
result = self.cur.fetchone()
if result:
return result[0]
except Exception as ex:
logging.warning(f"Couldn't get {key} for {path} w/{size}, {mtime_ns}: {ex}")
with self.lock:
self.cur.execute(self.select_query.format(key=key), {"path": str(path), "size": size, "mtime_ns": mtime_ns})
result = self.cur.fetchone()
if result:
return result[0]
return None
@ -162,14 +158,12 @@ class FilesDB:
stat = path.stat()
size = stat.st_size
mtime_ns = stat.st_mtime_ns
try:
with self.lock:
self.cur.execute(
self.insert_query.format(key=key),
{"path": str(path), "size": size, "mtime_ns": mtime_ns, "value": value},
)
except Exception as ex:
logging.warning(f"Couldn't put {key} for {path} w/{size}, {mtime_ns}: {ex}")
with self.lock:
self.cur.execute(
self.insert_query.format(key=key),
{"path": str(path), "size": size, "mtime_ns": mtime_ns, "value": value},
)
def commit(self) -> None:
with self.lock:
@ -271,25 +265,34 @@ class File:
self.size = nonone(stats.st_size, 0)
self.mtime = nonone(stats.st_mtime, 0)
elif field == "digest_partial":
self.digest_partial = filesdb.get(self.path, "digest_partial")
if self.digest_partial is None:
self.digest_partial = self._calc_digest_partial()
filesdb.put(self.path, "digest_partial", self.digest_partial)
try:
self.digest_partial = filesdb.get(self.path, "digest_partial")
if self.digest_partial is None:
self.digest_partial = self._calc_digest_partial()
filesdb.put(self.path, "digest_partial", self.digest_partial)
except Exception as e:
logging.warning("Couldn't get digest_partial for %s: %s", self.path, e)
elif field == "digest":
self.digest = filesdb.get(self.path, "digest")
if self.digest is None:
self.digest = self._calc_digest()
filesdb.put(self.path, "digest", self.digest)
try:
self.digest = filesdb.get(self.path, "digest")
if self.digest is None:
self.digest = self._calc_digest()
filesdb.put(self.path, "digest", self.digest)
except Exception as e:
logging.warning("Couldn't get digest for %s: %s", self.path, e)
elif field == "digest_samples":
size = self.size
# Might as well hash such small files entirely.
if size <= MIN_FILE_SIZE:
setattr(self, field, self.digest)
return
self.digest_samples = filesdb.get(self.path, "digest_samples")
if self.digest_samples is None:
self.digest_samples = self._calc_digest_samples()
filesdb.put(self.path, "digest_samples", self.digest_samples)
try:
self.digest_samples = filesdb.get(self.path, "digest_samples")
if self.digest_samples is None:
self.digest_samples = self._calc_digest_samples()
filesdb.put(self.path, "digest_samples", self.digest_samples)
except Exception as e:
logging.warning(f"Couldn't get digest_samples for {self.path}: {e}")
def _read_all_info(self, attrnames=None):
"""Cache all possible info.

View File

@ -1,8 +1,3 @@
=== 4.3.1 (2022-07-08)
* Fix issue where cache db exceptions could prevent files being hashed (#1015)
* Add extra guard for non-zero length files without digests to prevent false duplicates
* Update Italian translations
=== 4.3.0 (2022-07-01)
* Redirect stdout from custom command to the log files (#1008)
* Update translations

View File

@ -2,16 +2,15 @@
# Andrew Senetar <arsenetar@gmail.com>, 2022
# Emanuele, 2022
# Fuan <jcfrt@posteo.net>, 2022
# Giovanni, 2022
#
msgid ""
msgstr ""
"Last-Translator: Giovanni, 2022\n"
"Last-Translator: Fuan <jcfrt@posteo.net>, 2022\n"
"Language-Team: Italian (https://www.transifex.com/voltaicideas/teams/116153/it/)\n"
"Language: it\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: utf-8\n"
"Plural-Forms: nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: qt/app.py:81
msgid "Quit"
@ -980,40 +979,37 @@ msgstr "Ignora file più grandi di"
#: qt\app.py:135 qt\app.py:293
msgid "Clear Cache"
msgstr "Svuota cache"
msgstr ""
#: qt\app.py:294
msgid ""
"Do you really want to clear the cache? This will remove all cached file "
"hashes and picture analysis."
msgstr ""
"Vuoi davvero svuotare la cache? Ciò rimuoverà tutti gli hash dei file "
"memorizzati nella cache e le analisi delle immagini."
#: qt\app.py:299
msgid "Cache cleared."
msgstr "Cache svuotata"
msgstr ""
#: qt\preferences_dialog.py:173
msgid "Use dark style"
msgstr "Usa stile scuro"
msgstr ""
#: qt\preferences_dialog.py:241
msgid "Profile scan operation"
msgstr "Profila l'operazione di scansione"
msgstr ""
#: qt\preferences_dialog.py:242
msgid "Profile the scan operation and save logs for optimization."
msgstr ""
"Profila l'operazione di scansione e salva i registri per l'ottimizzazione."
#: qt\preferences_dialog.py:246
msgid "Logs located in: <a href=\"{}\">{}</a>"
msgstr "I log si trovano in: <a href=\"{}\">{}</a>"
msgstr ""
#: qt\preferences_dialog.py:291
msgid "Debug"
msgstr "Debug"
msgstr ""
#: qt\about_box.py:31
msgid "About {}"
@ -1025,7 +1021,7 @@ msgstr "Versione {}"
#: qt\about_box.py:49 qt\about_box.py:75
msgid "Checking for updates..."
msgstr "Controllo degli aggiornamenti..."
msgstr ""
#: qt\about_box.py:54
msgid "Licensed under GPLv3"
@ -1033,11 +1029,11 @@ msgstr "Distribuito sotto licenza GPLv3"
#: qt\about_box.py:68
msgid "No update available."
msgstr "Nessun aggiornamento disponibile."
msgstr ""
#: qt\about_box.py:71
msgid "New version {} available, download <a href=\"{}\">here</a>."
msgstr "È disponibile la nuova versione {}, scaricabile <a href=\"{}\">qui</a>."
msgstr ""
#: qt\error_report_dialog.py:50
msgid "Error Report"