Genre tag for internet radiostations

FireFly Media Server Firefly Media Server Forums Firefly Media Server Feature Requests Genre tag for internet radiostations

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

    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)
  • The forum ‘Feature Requests’ is closed to new topics and replies.