I had a quick glance at the code and saving the queue as JSON is.... odd. I'm too lazy to inspect deeply but it consider subsongs?
My implementation does because I save as fpl using...
try
{
playlist_loader::g_save_playlist(playlist_path, handles, fb2k::noAbort);
}
catch (...) {}
edit: code for restoring the fpl during on_init...
void restore_playlist()
{
if (!is_file(playlist_path)) return;
pfc::string_list_impl list;
list.add_item(playlist_path);
static constexpr uint32_t flags = playlist_incoming_item_filter_v2::op_flag_no_filter | playlist_incoming_item_filter_v2::op_flag_delay_ui;
auto ptr = process_locations_notify::create([](metadb_handle_list_cref handles)
{
PlaybackQueueCallback::Scope scope;
auto plman = playlist_manager::get();
QueueList::add_handles_to_queue(plman, handles);
});
playlist_incoming_item_filter_v2::get()->process_locations_async(list, flags, nullptr, nullptr, nullptr, ptr);
}