AlbumInfo.image is always empty (1 Viewer)

ElSanto

Portal Member
August 28, 2007
40
1
39
Würzburg City
Home Country
Germany Germany
Hello,

I am playing around with the MediaPortal API to get ready to write a fabalous plugin :)
I tried out the music database and just created a list with all the albums on my MediaPortal.
When I now try to get the Cover of the selected AlbumInfo object, the AlbumInfo.Image property is always an empty String.
Does anyone have an idea what could be wrong? Or is there another way to retrieve the Cover art for an album? Is "Image" the right property? I miss documentation for that :(

Sample Code:

albums = new List<AlbumInfo>(4096);
MediaPortal.Music.Database.MusicDatabase.Instance.GetAllAlbums(ref albums);

foreach (AlbumInfo info in albums)
{
LogServer.sharedLog().addLogMessage(info.Image);
}


Thank you in advance for any help !! :)
 

jameson_uk

Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    Home Country
    United Kingdom United Kingdom
    Code:
    MediaPortal.Music.Database.MusicDatabase.Instance.GetAllAlbums(ref albums);
    Never actually used that method before but it is not quite doing what is says in the name.

    It retrieves a list of albums from the database but then returns a collection of AlbumInfo which is normally the class used to model the album info scraped from allmusic.com. It is creating an instance of AlbumInfo on the fly but only setting artist, album artist and album hence why the image is not set.

    If you want a list of albums and their thumbs you can do this using the code you have in combination with some thumb code

    The code the music plugin uses to load local thumbs is
    Code:
    string strThumb = Util.Utils.GetAlbumThumbName(strArtistName, strAlbumName);
    it then goes on to look for a folder thumb if one is not found.
     
    Last edited:

    ElSanto

    Portal Member
    August 28, 2007
    40
    1
    39
    Würzburg City
    Home Country
    Germany Germany
    Thank you so much Jameson!!!!
    You made my day :) Btw... the fileName has some underscores inserted and it does not seem to be a rule because the real name of the file does not have does underscores. For example: ...\Thumbs\Music\Albums\5Bugs _-Best Off.jpg
    Does anybody know the rule how those underscores are inserted and how i can get rid of them?

    Thanks
     

    Users who are viewing this thread

    Top Bottom