Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Folder cover art

Help
Manu
2011-04-15
2013-05-30
  • Manu
    Manu
    2011-04-15

    Hello,

    covert art are normally supported by Mediatomb for music files but not for folders or am I wrong? This is done during metadata parsing though addition of a CdsResource to an element. Is it possible to do that for an element id in the ContentManager? (for example with the function updateObject?)

    I tried to add the code

            if ( cds_obj->getMetadata(MT_KEYS[M_TRACKNUMBER].upnp).c_str() && ! strcmp(cds_obj->getMetadata(MT_KEYS[M_TRACKNUMBER].upnp).c_str(), "1") ) {
    
                    int resCount = cds_obj->getResourceCount();
                     for (int i = 0; i < resCount; i++)
                    {
                    String rct;
                    rct = cds_obj->getResource(i)->getParameter(_(RESOURCE_CONTENT_TYPE));
                    if ( rct == ID3_ALBUM_ART )
                        Ref<CdsResource> resourceCouverture = cds_obj->getResource(i);
                        zmm::Ref<Dictionary> params;
            //          cm->updateObject(id, params);
                }
            }
    

    to the js_functions.cc but don't really know how to finalize that…

    Any ideas?

    Thanks
    Kind regards
    Emmanuel

     
  • Manu
    Manu
    2011-05-19

    Hello,

    tried to add the following to get an album artwork on folder.
    I get what I want in the logs in case rct == ID3_ALBUM_ART

    but no artwork shown in the media manager…

    Any ideas?

    Emmanuel

        // If song number is 1, add an artwork to container
            if ( cds_obj->getMetadata(MT_KEYS[M_TRACKNUMBER].upnp).c_str() && ! strcmp(cds_obj->getMetadata(MT_KEYS[M_TRACKNUMBER].upnp).c_str(), "1") ) {
    
        int resCount = cds_obj->getResourceCount();
             for (int i = 0; i < resCount; i++)
             {
                    String rct;
                rct = cds_obj->getResource(i)->getParameter(_(RESOURCE_CONTENT_TYPE));
            if ( rct == ID3_ALBUM_ART ) 
            {
                            Ref<CdsResource> resourceCouverture = cds_obj->getResource(i);
                            Ref<Storage> storage = Storage::getInstance();
                Ref<CdsObject> obj = storage->loadObject(id);
                            obj->addResource(resourceCouverture);
                            log_info("Artwork added to %s\n", cds_obj->getMetadata(MT_KEYS[M_ALBUM].upnp).c_str() );
                    }
                  }
            }