moodle-buddy icon indicating copy to clipboard operation
moodle-buddy copied to clipboard

Feature request: get last modified date and use it to check for resource updates

Open GRBaset opened this issue 3 years ago • 4 comments

Hello, it'd be nice to have the option to check for updates in already downloaded resources, which is quite a common occurrence in my university's Moodle, and there's no indication in the frontend that they have been updated.

This could be done by sending a HEAD request to get the headers for all files and comparing the last-modified header with the previously stored date (I tried it and it works, at least on my Moodle). Then when downloaded, depending on configuration, either store it with another name as a new version or replace the existing file.

An additional feature that could be derived from this would be to set the dowloaded file's last modified date, or append it to the name if not possible.

Thanks.

GRBaset avatar Oct 12 '21 17:10 GRBaset

Thanks for this suggestion! Once I find some time I can look into it :) I will let you know once I made any progress.

marcelreppi avatar Oct 14 '21 15:10 marcelreppi

This feature is now available in version 1.52. Look for "Detect updates for previously scanned files" and "Prepend Moodle's last modified timestamp to each file name" in the options. Hope this helps!

marcelreppi avatar Dec 14 '21 20:12 marcelreppi

I tested it and it seems to be working mostly OK, thank you. However, the last modified timestamp is only prepended when the resource updated, but not in the first download.

GRBaset avatar Dec 15 '21 14:12 GRBaset

Alright I will look into it when I find some time :)

marcelreppi avatar Dec 16 '21 11:12 marcelreppi