def get_files_to_remove(self):
files_to_remove = {}<EOL>needful_files = self.get_needful_files()<EOL>for resources_type, resources in self.get_uploaded_resources():<EOL><INDENT>exclude_paths = self.get_exclude_paths()<EOL>resources = {resource for resource in resources if not resource.startswith(exclude_paths)}<EOL>files_to_remove[resources_type] = resources - needful_files<EOL><DEDENT>return files_to_remove<EOL>
Returns orphaned media files to be removed grouped by resource type.
All files which paths start with any of exclude paths are ignored.