from clarabot_nano.core.config.update.base import AbstractRemoteConfigUpdateHandler


class UpdateIndexerIgnoredMimes(AbstractRemoteConfigUpdateHandler):
    HANDLER_KEY = "indexer_ignored_mimes"

    def _execute(self, data: dict):
        self._c["indexer_ignored_mimes"] = data["indexer_ignored_mimes"]

    def _describe_change(self, old_config: dict, new_config: dict, data: dict) -> str:
        return f"Indexer ignores mimes set to {new_config.get('indexer_ignored_mimes')!r}"
