We are looking for a way to identify where a media asset is linked to, so I'm looking to understand how does EPiServer determine asset usage when it displays the messages 'Changes made here will affect at least ...' and 'This item is not used anywhere'?
What our customer actually wants is a report on all assets which are not linked to anywhere, I suspect that we are going to need to report on the results of a scheduled job something like a reverse of the Link Validation job which would then need to query each asset to find usage (or lack thereof), so if anybody has any ideas on alternative approaches, then that would also be appreciated.
You can find all links to a specific content by quering the ContentSoftLinkRepository. So if no links are found, the media content is not in use (hopefully). Media content may be in use, even if no other content links to it, e.g. you may have a block where the editor can chose a folder to list files from. Then there are no links to the files, but they are still in use.
This was on the back burner for a while but we have eventually got around to implementing it. Thanks Johan for that, perfect. To report on this efficiently for the entire site we added some ContentReference extension methods which query the ContentSoftLinkRepository, we then include these in our EPiServer find index for instances of MediaData.