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: Problem with process_locations_notify and update_info_async_simple (Read 1285 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Problem with process_locations_notify and update_info_async_simple

Code: [Select]
# my add tracks function, in std::vector stores only remote http urls
static void add_tracks(std::vector<std::string> tracks)
{
pfc::list_t<const char*> p_urls;
service_ptr_t<process_locations_notify_my> p_notify = new service_impl_t<process_locations_notify_my>();

for (size_t i = 0; i < tracks.size(); i++) {
p_urls.add_item(tracks[i].c_str());
}
static_api_ptr_t<playlist_incoming_item_filter_v2>()->process_locations_async(
p_urls,
playlist_incoming_item_filter_v2::op_flag_background,
NULL,
NULL,
NULL,
p_notify
);
}

class process_locations_notify_my : public process_locations_notify {
public:
void on_completion(const pfc::list_base_const_t<metadb_handle_ptr>& p_items)
{
static_api_ptr_t<playlist_manager> plm;
static_api_ptr_t<metadb_io_v2> metadb_io_api;
file_info_impl info;

p_items[0]->get_info(info);

info.meta_set("artist", "artist");
info.meta_set("title", "title");

metadb_io_api->update_info_async_simple(
pfc::list_single_ref_t<metadb_handle_ptr>(p_items[0]),
pfc::list_single_ref_t<const file_info*>(&info),
core_api::get_main_window(), NULL, NULL);

plm->activeplaylist_add_items(p_items, bit_array_true());
};

void on_aborted() {};
};

When this code is running and fb2k is processing locations, i get this error:

Code: [Select]
Could not update tags (Access denied) on:
"https://localhost:8000/api/track/904209092.mp3"

Track plays fine but seems fb2k cant fetch metadata from this track.

Re: Problem with process_locations_notify and update_info_async_simple

Reply #1
ALSO: I tried to see track metadata manually, metadata is fine with artist info, album info and duration but fb2k shows "??" on artist and album field.