Commit f314e509 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

media_library: Add an artist's album getter

parent 8c72e728
......@@ -30,6 +30,7 @@
#include "IMediaLibrary.h"
#include "IVideoTrack.h"
#include "IArtist.h"
#include "media_library_private.hpp"
#include "system_storage.h"
......@@ -269,6 +270,20 @@ media_library_get_artists( media_library* p_ml, media_library_list_cb cb, void*
artistToArtistItem);
}
void
media_library_get_artist_albums( media_library* p_ml, const char* psz_artistName, media_library_list_cb cb, void* p_user_data )
{
auto artist = p_ml->ml->artist(psz_artistName);
if (artist == nullptr)
{
LOGE("Can't find artist %s", psz_artistName);
return;
}
media_library_common_getter(cb, p_user_data,
std::bind(&IArtist::albums, artist),
&albumToAlbumItem);
}
void
media_library_register_on_change(media_library* ml, media_library_file_list_changed_cb cb, void* p_data)
{
......
......@@ -64,6 +64,9 @@ media_library_get_video_files( media_library* p_ml, media_library_list_cb cb, vo
void
media_library_get_audio_files( media_library* p_ml, media_library_list_cb cb, void* p_user_data );
void
media_library_get_artist_albums( media_library* p_ml, const char* psz_artistName, media_library_list_cb cb, void* p_user_data );
void
media_library_get_albums( media_library* p_ml, media_library_list_cb cb, void* p_user_data );
......
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