Closed benoit74 closed 9 months ago
I was convinced we had test CI in place to confirm image build is OK in PRs too ; I expected to test the build locally (and fix it, because I knew it would be KO) but once I saw the branch is green after I finished to prepare the first comment with all details, I thought "oh, great, I did good job" 🤦🏻
Sorry ...
Rationale
https://github.com/offspot/metrics/ needs to compute the number of files added and removed in the file manager.
Current tinyfilemanager code does not permit to process URLs to detect this information, so we are now patching tinyfilemanager to add response headers when files have been added and removed, with the number of files added / removed.
Changes
$files_added
and$files_deleted
to store amount of files added or deleted in a given requestfm_report_files
function which really output the headers when neededfm_count_files
function to count files in a given folderX-TFM-Files-Added
header is returned with the number of files added (only when files have been added):fm_count_files
function for that)X-TFM-Files-Deleted
header is returned with the number of files deleted (only when files have been deleted):