from typing import List


def mimes_to_codec(mimes: List[str]) -> str:
    """Utility function for turning mutagen's mime types into a single codec string."""
    if any(["codecs=opus" in m for m in mimes]):
        return "opus"
    else:
        return mimes[0].replace("audio/", "")