'Finds and removes all redundant files (Mac OS metadata files with filename ".DS_Store"
or filename starts with "._") for all courses'

def remove_redundant_content_for_courses(self):

    assets_to_delete = 0
    for prefix in ['_id', 'content_son']:
        query = SON([('{}.tag'.format(prefix), XASSET_LOCATION_TAG), ('{}.category'.format(prefix), 'asset'), ('{}.name'.format(prefix), {'$regex': ASSET_IGNORE_REGEX})])
        items = self.fs_files.find(query)
        assets_to_delete = (assets_to_delete + items.count())
        for asset in items:
            self.fs.delete(asset[prefix])
        self.fs_files.remove(query)
    return assets_to_delete
