def file_downloaded(self, name: str,
size: int, modification_time: float) -> Optional[FileDownloaded]:
"""
Returns download path and filename if a file with matching
name, modification time and size has previously been downloaded
:param name: file name, not including path
:param size: file size in bytes
:param modification_time: file modification time
:return: download name (including path) and when it was
downloaded, else None if never downloaded
"""
conn = sqlite3.connect(self.db, detect_types=sqlite3.PARSE_DECLTYPES)
c = conn.cursor()
c.execute(
"""SELECT download_name, download_datetime as [timestamp] FROM {tn} WHERE
file_name=? AND size=? AND mtime=?""".format(tn=self.table_name),
(name, size, modification_time)
)
row = c.fetchone()
if row is not None:
return FileDownloaded._make(row)
else:
return None
From this code the answer is clear: one of the name, modification time or size has changed.
I assume what has happened is that you have changed time zone or had daylight savings apply.
Cameras do not record file time in UTC. They do it in local time.
It would be great if Rapid Photo Downloader could somehow be made to work around this problem. It is a truly difficult problem to solve. It requires the camera to record the time zone in the photo / video metadata. Some cameras do this but when I last looked, as I recall, there is no consistent metadata standard for it. Which is a real pain in the arse.
In the meantime, if I were you I would not use your SD card as a backup medium. Backup your photos onto multiple other mediums, e.g. hard drives, cloud backup.