You are here: Home » Topic » Genre tag for internet radiostations

Genre tag for internet radiostations

This topic contains 0 replies, has 0 voices, and was last updated by  servies 11 years ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #690

    servies

    While scanning through the code i noticed that there are only three tag-fields being used for internet radiostations.
    I thought it would be nice to have at least the ‘Genre’ tag also available.
    I don’t know if this breaks some protocols, maybe the Roku Soundbridge expects it to be empty in case of an internet radiostation?… but the following simple patch provides the mentioned functionality.
    The genre tag is optional, so it doesn’t create any problems with existing .url files…

    diff -r --context mt-daapd-svn-1400/src/scan-url.c mt-daapd-svn-1400.patch/src/scan-url.c
    *** mt-daapd-svn-1400/src/scan-url.c 2006-10-09 07:06:16.000000000 +0200
    --- mt-daapd-svn-1400.patch/src/scan-url.c 2006-10-18 22:22:53.000000000 +0200
    ***************
    *** 60,66 ****
    head=linebuffer;
    tail=strchr(head,',');
    if(!tail) {
    ! DPRINTF(E_LOG,L_SCAN,"Badly formatted .url file - must be bitrate,descr,urln");
    fclose(infile);
    return FALSE;
    }
    --- 60,66 ----
    head=linebuffer;
    tail=strchr(head,',');
    if(!tail) {
    ! DPRINTF(E_LOG,L_SCAN,"Badly formatted .url file - must be bitrate,descr,url[,genre]n");
    fclose(infile);
    return FALSE;
    }
    ***************
    *** 69,88 ****
    head=++tail;
    tail=strchr(head,',');
    if(!tail) {
    ! DPRINTF(E_LOG,L_SCAN,"Badly formatted .url file - must be bitrate,descr,urln");
    fclose(infile);
    return FALSE;
    }

    ! *tail++='';
    !
    pmp3->title=strdup(head);
    ! pmp3->url=strdup(tail);
    fclose(infile);

    DPRINTF(E_DBG,L_SCAN," Title: %sn",pmp3->title);
    DPRINTF(E_DBG,L_SCAN," Bitrate: %dn",pmp3->bitrate);
    DPRINTF(E_DBG,L_SCAN," URL: %sn",pmp3->url);

    return TRUE;
    }
    --- 69,100 ----
    head=++tail;
    tail=strchr(head,',');
    if(!tail) {
    ! DPRINTF(E_LOG,L_SCAN,"Badly formatted .url file - must be bitrate,descr,url[,genre]n");
    fclose(infile);
    return FALSE;
    }

    ! *tail='';
    pmp3->title=strdup(head);
    ! head = ++tail;
    ! tail=strchr(head,',');
    !
    ! if(!tail) {
    ! pmp3->url=strdup(head);
    ! pmp3->genre=strdup("");
    ! }
    ! else {
    ! *tail++='';
    ! pmp3->url=strdup(head);
    ! pmp3->genre=strdup(tail);
    ! }
    !
    fclose(infile);

    DPRINTF(E_DBG,L_SCAN," Title: %sn",pmp3->title);
    DPRINTF(E_DBG,L_SCAN," Bitrate: %dn",pmp3->bitrate);
    DPRINTF(E_DBG,L_SCAN," URL: %sn",pmp3->url);
    + DPRINTF(E_DBG,L_SCAN," Genre: %sn",pmp3->genre);

    return TRUE;
    }
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.