Skip to content

AP-687 Only download files if local file is older#13

Merged
jason-raitz merged 7 commits into
mainfrom
AP-687_only-redownload-changed-images
May 27, 2026
Merged

AP-687 Only download files if local file is older#13
jason-raitz merged 7 commits into
mainfrom
AP-687_only-redownload-changed-images

Conversation

@jason-raitz
Copy link
Copy Markdown
Contributor

  • given a UTC modified datetime string for the requested file, we now check if the file exists locally and has a newer mtime

 - given a UTC modified datetime string for the requested file,
   we now check if the file exists locally and has a newer mtime
@jason-raitz jason-raitz self-assigned this May 22, 2026
@jason-raitz jason-raitz marked this pull request as ready for review May 22, 2026 15:38
Copy link
Copy Markdown
Member

@awilfox awilfox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+wc; minor documentation fixes.

Comment thread CHANGELOG.md Outdated
Comment thread tind_client/client.py Outdated
Comment thread tind_client/client.py Outdated
Comment thread tind_client/client.py Outdated
@awilfox
Copy link
Copy Markdown
Member

awilfox commented May 22, 2026

It would be nice to have a test. We should be able to mock stat to return specific dates instead of relying on fixture dates / filesystem stuff.

jason-raitz and others added 3 commits May 26, 2026 11:54
Co-authored-by: Anna Wilcox <AWilcox@Wilcox-Tech.com>
Co-authored-by: Anna Wilcox <AWilcox@Wilcox-Tech.com>
@awilfox
Copy link
Copy Markdown
Member

awilfox commented May 26, 2026

I'm thinking about this and… Should we pass in a datetime instead of a str for modified? It feels very ugly to pass in a str, especially an underspecified string.

Copy link
Copy Markdown
Member

@anarchivist anarchivist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+wc

Comment thread CHANGELOG.md Outdated
Comment thread tind_client/client.py Outdated
return records[0]

def fetch_file(self, file_url: str, output_dir: str = "") -> str:
def fetch_file(self, file_url: str, output_dir: str = "", modified: str = "") -> str:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

following @awilfox's suggestion, i think modified should actually be a datetime.datetime - it shouldn't be this method's responsibility to convert the incoming string into a value that can be compared.

Copy link
Copy Markdown
Member

@awilfox awilfox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+ Looks great to me.

@jason-raitz jason-raitz merged commit d7c28a0 into main May 27, 2026
6 checks passed
@jason-raitz jason-raitz deleted the AP-687_only-redownload-changed-images branch May 27, 2026 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants