Commit 9576086d authored by Ludovic Fauvet's avatar Ludovic Fauvet

artist_item: add number of albums for the given artist

parent 757d324f
......@@ -34,6 +34,7 @@ artist_item_create(const char* psz_name)
if (p_item == NULL)
return NULL;
p_item->i_library_item_type = LIBRARY_ITEM_ARTIST;
p_item->i_nb_albums = 0;
if (psz_name != NULL && *psz_name != 0)
{
p_item->psz_name = strdup(psz_name);
......@@ -64,6 +65,7 @@ artist_item_copy(const artist_item* p_item )
return NULL;
if (p_item->psz_artwork != NULL)
p_new->psz_artwork = strdup(p_item->psz_artwork);
p_new->i_nb_albums = p_item->i_nb_albums;
return p_new;
}
......
......@@ -39,6 +39,7 @@ typedef struct artist_item
char* psz_name;
char* psz_artwork;
uint32_t i_nb_albums;
} artist_item;
artist_item*
......
......@@ -153,5 +153,8 @@ artistToArtistItem( ArtistPtr artist )
return nullptr;
if (artist->artworkUrl().empty() == false)
p_item->psz_artwork = path_from_url( artist->artworkUrl().c_str() );
auto albums = artist->albums();
p_item->i_nb_albums = albums.size();
return p_item;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment