Does playlist_oper::process_locations add files to the database if they are not there already? is metadb::user_requested_remove the way to go to remove dead entries?
Here's the functions as I envision them:
CODE
void database_scan_music_directory()
{
string8 music_path = g_music_directory;
ptr_list_t<const char> file_list;
metadb_handle_list handles;
file_list.add_item(music_path);
playlist_oper::get()->process_locations(file_list, handles);
handles.delete_all();
}
CODE
void database_prune_dead_entries()
{
metadb_handle_list handles;
metadb::get()->database_lock();
metadb::get()->get_all_entries(handles);
for (int i=0;i<handles.get_count();i++)
{
const playable_location *play = handles[i]->handle_get_location();
if (input::is_entry_dead(play))
{
metadb::get()->user_requested_remove(play);
}
}
handles.delete_all();
metadb::get()->database_unlock();
}
Thanks
