Loosing tracking of already downloaded images and videos

Hi
I use a single SD-card in my camera, that can store images/videos for a year. If the card is full, I just delete the oldest stuff. The most of the time it works as expected, Rapid Download Helper finds the current data and only downloads those that haven’t been downloaded.
Sometimes RDH losts track of the already downloaded files, and detects old files as new.
I don’t understand, how does it work, how does it keeps track of old data, and what can cause it to fail.
Thanks!

From the code:

    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.

2 Likes