Skip to content

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

@GitCourser

Description

@GitCourser
    # 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions