Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Using get_library_index() from on_library_initialized breaks everything. (Read 560 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Using get_library_index() from on_library_initialized breaks everything.

I thought this would be safe to do but it very much isn't...

Code: [Select]
class LibraryCallback : public library_callback_v2
{
public:
void on_library_initialized() final
{
auto index = search_index_manager::get()->get_library_index();
}

void on_items_added(metadb_handle_list_cref) final {}
void on_items_modified(metadb_handle_list_cref) final {}
void on_items_modified_v2(metadb_handle_list_cref, metadb_io_callback_v2_data&) final {}
void on_items_removed(metadb_handle_list_cref) final {}
};

FB2K_SERVICE_FACTORY(LibraryCallback);

It prevents stock album list from populating itself which is um.... not good. The original bug report came from someone using Columns/foo_uie_albumlist and the mere presence of my component which contains the above code was the cause of that not updating itself as well. I isolated it down to that one line.