function sweepGeneratedMedia
sweepGeneratedMedia(): Promise<number>

Deletes the generated files nothing serves any more, and returns how many: the scaled copies of an upload that is gone, which the services' own removals missed or never made, as for a user's avatar; the previews of image dumps under their former name, <id>.preview.jpg or .png, which the scaled copies replaced; and the temporary files a generation left unfinished. Nothing else of THUMBNAILS_DIR is touched, the custom thumbnails kept there being uploads.

Return Type

Promise<number>

Usage

import { sweepGeneratedMedia } from "api/lib/ffmpeg.ts";