Skip to content

Conversation

@D-VR
Copy link
Collaborator

@D-VR D-VR commented Nov 17, 2025

This supersedes PR #128

Brief overview of the new file updating logic:

  • per‑course caches are stored as .syncmymoodle_cache inside each course directory. Each cache contains the full tree of the last full sync for the course (could be split into just a course subtree in the future)
  • During downloads, we use the course cache to compare Moodle's timemodified with the previous value. If it hasn't changed, we skip re‑downloading the file
  • When Moodle's timemodified changed, we use the cached ETag to detect local modifications: if the local file's content hash no longer matches the old ETag, we treat it as a local change and apply a configured conflict strategy
  • We Support configurable conflict handling via update_files_conflict (rename, keep, overwrite), with rename moving modified files to .syncconflict..
  • If there is no cache (yet), we compare the current Moodle ETags with the existing local files, and treat matching files as up‑to‑date

closes #77

@D-VR D-VR merged commit 4ee6ac7 into master Nov 18, 2025
4 checks passed
@D-VR D-VR deleted the add-safe-file-updating branch November 18, 2025 06:50
@D-VR D-VR added the enhancement New feature or request label Nov 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compare moodle timemodified with timestamp of local files

3 participants