You are here: Home » Topic » Alternative database handling for “compilations”

Alternative database handling for “compilations”

FireFly Media Server (formerly mt-daapd) Firefly Media Server Forums Firefly Media Server Feature Requests Alternative database handling for “compilations”

This topic contains 13 replies, has 3 voices, and was last updated by  rpedde 11 years, 6 months ago.

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #191

    tri
    Participant

    Hi

    This is little something I’ve been thinking about for a while.

    Let’s say that originally stuff in the database is:

    TITLE=”Song Title”
    ALBUM=”Album Title”
    ARTIST=”Artist Name”

    I’d like to be able to configure mt-daapd so that in case the
    compilation-flag in the song is present, it would be entered to the
    database e.g. as following:

    TITLE=”Artist Name: Song Title”
    ALBUM=”Album Title”
    ARTIST=”Various Artists”

    I know that the media server is not necessarily the most logical place to
    do this, but on the other hand it’s more or less the only place changes can
    be made in the world of closed source players if one doesn’t want to
    totally screw up the metadata in the music files.

    This is something that would be quite useful for us Roku-player users. One
    alternative could be that mt-daapd could be present as two daap-server
    instances: one with original tags and one with alternative data.

    #4053

    ajayre
    Participant

    I have the same problem, but the exact reverse. I used CDex to rip and it set the artist to Various, and put the actual artist name in the song title.

    Andy

    #4054

    rpedde
    Participant

    I had some thoughts on that — there is a function called “make_composite_tags” that shuffles around tags for those that are orchestral in a similar way.

    Likewise, there was some call to do some other things like that — massage the comment field for various purposes (like doing interesting things with applescript on the client side).

    I was trying to decide if it made sense to do some kind of general purpose comment transformation thing, or if I should just special case each common case like the one you are talking about — a “concat artist and title for compilations” or a “split artist and title for compilations”

    I’m not opposed to the one you are suggesting, tri.

    #4055

    ajayre
    Participant

    How do the MP3 tags relate to mt-daapd and the SoundBridge? Do you have to transform the tags only for the streaming MP3 but leave the tags on the MP3 in the filesystem alone? Or do you give the artist/album/etc seperately to the Soundbridge and it doesn’t read the tags?

    What would be perfect for me is to transform all MP3s in the various folder (I think you already have that implemented for the compilations flag), and use a regexp to transform the current title into a new artist and title. But not modify the tags in the MP3 stored in the filesystem.

    Andy

    #4056

    tri
    Participant

    rpedde wrote:

    I had some thoughts on that — there is a function called “make_composite_tags” that shuffles around tags for those that are orchestral in a similar way.

    I’m not opposed to the one you are suggesting, tri.

    Hahumm, maybe I’ll make some minimalistic effort to implement
    the functionality. In the mean time, there seems to be a buffer
    overflow bug in make_composite_tags. If a file has both orchestra and
    conductor but no artist, the artist becomes “orchestra – conductor”, but
    allocated buffer does not have enough space for terminating nul-char.

    #4057

    rpedde
    Participant

    look at cvs — your function is already there.

    You’ll have to convert your config file to the .ini file config to make it work:

    rather than:

    key1 value1
    key2 value2

    you have to change your conf file to:

    [general]
    key1=value1
    key2=value2
    key3=value3

    and add a section like this:

    [scanning]
    concat compilations=1

    — Ron

    #4058

    tri
    Participant

    rpedde wrote:

    look at cvs — your function is already there.

    Great. Maybe I’ll wait for the next nightly snapshot anyways.

    –tri

    #4059

    rpedde
    Participant

    I’m trying to cram the playlist parser and the browse/query parser into the same parser. Once I get that, I’ll add the comment-preservation into the config file reader, and add automagic-config-file-fixuping.

    Probably be Sat.

    — Ron

    #4060

    tri
    Participant

    Here is a patch against the 20060317 that is doing the compilation
    concat in a way I meant. Some constants in the beginning of the
    make_composite_tags fuction could possibly be made configurable,
    but maybe it’s not necessary. I also refactored the function a bit.

    The only change outside the make_composite_tags function
    is that I moved compilation detection of the compilation path
    a couple lines up in the code. However, it seems to be no-op
    anyways in the current code, but anyways, it’s the correct place.

    The patch is in:
    http://www.iki.fi/tri/mt-daapd/patch/mt-daapd-cvs-20060317-composite-tags.patch

    The patched mp3-scanner.c is in:

    http://www.iki.fi/tri/mt-daapd/patch/mp3-scanner.c-20060317-patched

    Of course it only concatenates the compilations.

    Regards,
    –tri

    #4061

    rpedde
    Participant

    there were some cut and paste errors in there, but I merged it substantially unchanged. I’ll work to get compdirs working again, fix a minor playlist problem and drop that tomorrow.

    — Ron

    #4062

    tri
    Participant

    rpedde wrote:

    there were some cut and paste errors in there, but I merged it substantially unchanged. I’ll work to get compdirs working again, fix a minor playlist problem and drop that tomorrow.

    Nice.

    Yeah, at least:

    } if (song->conductor) {

    should be:

    } else if (song->conductor) {

    Doesn’t crash because of that anyways.

    Regards

    – .-. ..

    #4063

    rpedde
    Participant

    and:


    + if (song->orchestra && song->conductor) {
    + len = (int)strlen(song->artist) +
    + (int)strlen(sep) +
    + (int)strlen(song->title);
    + ptmp = (char*)malloc(len + 1);
    + if(ptmp) {
    + sprintf(ptmp,"%s%s%s",song->orchestra, sep, song->conductor);
    + song->artist = ptmp;
    + }

    should probably be:


    len = (int)strlen(song->orchestra) ... (int)strlen(song->conductor);

    but I saw where you were going with it. I’ll probably drop a nightly now just to get fixes out, and finish up the compdir stuff tomorrow.

    #4064

    tri
    Participant

    Oops 🙂

    #4065

    rpedde
    Participant

    That would be hard. Not impossible, but hard.

    But you aren’t the only one in the same boat, and that’s what the “compdirs” config value is. If you have all your soundtracks in a folder called “/music/Sountracks”, then you can mark that folder as a compilation by using the compdirs dirctive:


    compdirs = /music/Soundtracks

    If that won’t work because they aren’t all in a single folder, then if you have some other naming convention, you can use that, since compdirs does a substring match on the whole path. So if you name your album something like “xxx soundtrack”, then you could do:


    compdirs = soundtrack

    and you could automatically flag anything with “soundtrack” in the path as a compilation.

    With the svn-909 nightly, the compdirs gets fixed up and if you set


    [scanning]
    concat compilations = 1

    then it will automatically concatinate artist and song into the song name, and set artist to “Various Artists”.

    I think that’s pretty close to what you are looking for. As far as donations, the ‘donate’ button on the sourceforge page is turned on, but I don’t actively solicit contributions. Really, the only thing a contribution would be good for would be to guilt me into driving development in a particular direction. 🙂

    — Ron

Viewing 14 posts - 1 through 14 (of 14 total)

You must be logged in to reply to this topic.