def get_channel_names_or_ids(metadata):
    """
    Get a list of unique channel names, using ID instead if a name is null or duplicated.

    Parameters
    ----------
    metadata : pd.DataFrame
        A DataFrame containing 'channels.name' and 'channels.id' columns

    Returns
    -------
    actual_channel_names : list of str
        Unique channels names or IDs.
    """
    actual_channel_names = []
    unique_ids = metadata.drop_duplicates(subset='channels.id')
    name_value_counts = unique_ids['channels.name'].value_counts()
    for index in range(len(unique_ids.index)):
        row = unique_ids.iloc[index]
        channel_name = row['channels.name']
        if not channel_name or name_value_counts[channel_name] > 1:
            actual_channel_names.append(row['channels.id'])
        else:
            actual_channel_names.append(channel_name)
    return actual_channel_names