Menu

abcbox import.js

Help
Marcel S.
2011-09-29
2013-05-30
  • Marcel S.

    Marcel S. - 2011-09-29

    Hi all,

    mediatomb has a very nice albeit cmplicated scripting engine to sort the data into virtual folders. and as I have quite a lot of mp3's and videos I am making use of the abcbox import.js and common.js.
    This works nice for the video files but there seem to be quite some bugs in the genre and photo parsing.

    1. Quite some of my mp3's contain multiple genres. This import.js seems to screw it up and sets e.g. the genre "pop rock" instead of setting it both into "pop" and "rock". Note that mt-daapd and minidlna seem to do this correct.
    Anyone know how to fix this? I am no good with javascript unfortunately.

    2. The Photo parsing seems not to work. I only see two folders, small and large images, and then all in one huge folder. That is not really useable. Anyone know whats wrong there?

     
  • Marcel S.

    Marcel S. - 2011-10-04

    The problem 1. I could now solve myself with some hacking. The abcbox script is simply buggy, here is what has to be used in the genre parsing to get a good result:

    var genre = obj.meta[M_GENRE];
        if (!genre)
        {
            genre = '-unknown-';
            genres[0] = '-unknown-';
        }
        else
        {
            genres = genre.split(' ');
            desc = desc + ', ' + genres[0];
        } //Only first genre in description
    
    // GENRE //
    for (var i = 0; i < genres.length; i++)
    {
        chain = new Array('-Audio-', '-Genre-', genres[i], '-all-');
        obj.title = title + ' - ' + artist_full;
        addCdsObject(obj, createContainerChain(chain), UPNP_CLASS_CONTAINER_MUSIC_GENRE);
        chain = new Array('-Audio-', '-Genre-', genres[i], abcbox(artist, 6, '-'), artist.charAt(0).toUpperCase(), artist, album);
            if (!discno) { obj.title = tracktitle; }
            else { obj.title = disctitle; }
            addCdsObject(obj, createContainerChain(chain), UPNP_CLASS_CONTAINER_MUSIC_ARTIST);
    }
    

    No idea yet what fails for the photo parsing.

     

Log in to post a comment.