Song Metadata Issue



Running Libretime instance on Ubuntu 16.04.4 LTS, Liquidsoap 1.1.1, all working great apart from song title metadata to shoutcast/icecast.

From my experiments it looks like Libretime uses the Artist/Title info embedded into the audio file for the shoutcast stream, which is fine if you have an MP3 library but mine is based on linear wavs for the highest quality and so I end up with no metadata at all.

Is there a way of adjusting it to take the Artist - Title info from the Libretime database entry for that file rather than the embedded metadata?





I’ve done some more poking around. It does look like there’s a portion of code in which looks like it should override the media metadata with that from the Libretime Library. I am trying to understand what this code does, my python knowledge isn’t great but I’ll try :slight_smile:

def create_liquidsoap_annotation(media):
    # We need liq_start_next value in the annotate. That is the value that controls overlap duration of crossfade.

    filename = media['dst']
    annotation = ('annotate:media_id="%s",liq_start_next="0",liq_fade_in="%s",' + \
            'liq_fade_out="%s",liq_cue_in="%s",liq_cue_out="%s",' + \
            'schedule_table_id="%s",replay_gain="%s dB"') % \
                    float(media['fade_in']) / 1000,
                    float(media['fade_out']) / 1000,

    # Override the the artist/title that Liquidsoap extracts from a file's metadata
    # with the metadata we get from Airtime. (You can modify metadata in Airtime's library,
    # which doesn't get saved back to the file.)
    if 'metadata' in media:

        if 'artist_name' in media['metadata']:
            artist_name = media['metadata']['artist_name']
            if isinstance(artist_name, str):
                annotation += ',artist="%s"' % (artist_name.replace('"', '\\"'))
        if 'track_title' in media['metadata']:
            track_title =  media['metadata']['track_title']
            if isinstance(track_title, str):
                annotation += ',title="%s"' % (track_title.replace('"', '\\"'))

    annotation += ":" + filename

    return annotation