I’m trying to find a way to obtain all usages of a mediafile. I can use MediaService.GetFileReferences or MediaService.GetFileReferenceCount but that will not tell me if the file is being used in a texteditor, for example. Is there a way to get ALL references to an image (including, for example texteditor fields)?
One way would be to query the database and the TextValue column of the Sites.PageFieldData and Sites.DraftPageFieldData tables. For each media file check if there’s any row where the TextValue column contains the media file id(guid) without the dashes.
Be cautious with querying the DB since it can affect the performance and crash the website, depending on too many rows and calculations.
Also there is a feature for this in the pipeline in future.