Skip to content

fix: don't look up the same file twice in one request; also: render function is pure again

Asbjørn Olling requested to merge better-filesize into main

After adding a bunch more metadata fields in !2 (merged) , the rss item rendering function would look up the environment variable, reconstruct the string path, make a file object, and find the file size of that - in the middle of rendering logic.

Now it parses the file data in the same place as the other stuff, in the renderable-file-data function - so we don't have to look up the file twice.

This also means that we don't have to look up an environment variable at runtime, so we pull static config back out into the handler creation; like it was before.

Merge request reports