browserforge icon indicating copy to clipboard operation
browserforge copied to clipboard

[bug] Problems with the IsDownloaded check can cause continuous repeated downloads

Open GitCourser opened this issue 3 months ago • 0 comments

    # Check if the file is older than a month
    file_creation_time = datetime.fromtimestamp(path.stat().st_ctime)
    one_month_ago = datetime.now() - timedelta(weeks=5)
    return file_creation_time >= one_month_ago

If the Windows file isn't deleted, creation time it will not change. Using st_ctime to determine will result in repeated downloads; it should be judged using the modification time, st_mtime.

    # Check if the file is older than a month
    file_mod_time = datetime.fromtimestamp(path.stat().st_mtime)
    one_month_ago = datetime.now() - timedelta(weeks=5)
    return file_mod_time >= one_month_ago

GitCourser avatar Sep 16 '25 02:09 GitCourser