Commit 5c029693 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

medialibrary: Add missing reload operation

parent 1718b63d
......@@ -401,6 +401,12 @@ enum vlc_ml_control
VLC_ML_BAN_FOLDER, /**< arg1: mrl (const char*) res: can't fail */
VLC_ML_UNBAN_FOLDER, /**< arg1: mrl (const char*) res: can't fail */
VLC_ML_LIST_FOLDERS, /**< arg1: entrypoints (vlc_ml_entrypoint_t**); arg2: nb results(size_t*), res: can fail */
/**
* Reload a specific folder, or all.
* arg1: mrl (const char*), NULL to reload all folders
* res: can't fail
*/
VLC_ML_RELOAD_FOLDER,
/* Pause/resume background operations, such as media discovery & media analysis */
VLC_ML_PAUSE_BACKGROUND, /**< no args; can't fail */
......@@ -554,6 +560,11 @@ static inline int vlc_ml_list_folder( vlc_medialibrary_t* p_ml,
return vlc_ml_control( p_ml, VLC_ML_LIST_FOLDERS, pp_entrypoints, p_nb_items );
}
static inline int vlc_ml_reload_folder( vlc_medialibrary_t* p_ml, const char* psz_mrl )
{
return vlc_ml_control( p_ml, VLC_ML_RELOAD_FOLDER, psz_mrl );
}
static inline int vlc_ml_pause_background( vlc_medialibrary_t* p_ml )
{
return vlc_ml_control( p_ml, VLC_ML_PAUSE_BACKGROUND );
......
......@@ -309,6 +309,15 @@ int MediaLibrary::Control( int query, va_list args )
*(va_arg( args, size_t*) ) = entryPoints.size();
break;
}
case VLC_ML_RELOAD_FOLDER:
{
auto mrl = va_arg( args, const char* );
if ( mrl == nullptr )
m_ml->reload();
else
m_ml->reload( mrl );
break;
}
case VLC_ML_PAUSE_BACKGROUND:
m_ml->pauseBackgroundOperations();
break;
......
Supports Markdown
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