def host_key(entry):
    """
    For a PlaylistEntry, return a hostname:port, or empty string for local files.
    """
    if entry.remote:
        port = entry.remote.port or ''
        return entry.remote.hostname.lower()+(':%d' % port if port else '')
    return ''