Help - Search - Members - Calendar
Full Version: update file path in Media Library
Hydrogenaudio Forums > Hosted Forums > foobar2000 > Development - (fb2k)
falling down the stairs
In the 0.8 SDK, I could use the following to update the path of a file in the database:

CODE
metadb::get()->file_moved(oldfilename, handle)

How do I do this for the Media Library in 0.9? It looks like file_move_helper would be useful here, but I'm not entirely sure how to use it.
falling down the stairs
Should I just remove the old reference and add the new one? That's what appears to be done in the 0.9 SDK...
My concern is that this won't automatically update the entries in the playlist(s) if I do it this way. Any thoughts?
foosion
See the static methods in the file_operation_callback class.
falling down the stairs
I tried using the method there, but it doesn't seem to do anything. (The Media Library entry's path didn't get updated.)

I did the following:

CODE
pfc::string8 oldfile, newfile;
oldfile = "file://F:\music\unsorted\The_Now_-_The_Other_Kid_With_20_Arms.mp3";
newfile = "file://F:\music\unsorted\rename_test.mp3";

pfc::string_list_impl l_from, l_to;
l_from.add_item(oldfile);
l_to.add_item(newfile);
service_ptr_t<file_operation_callback> cb;
cb->g_on_files_moved(l_from, l_to);

The file was definitely in the Media Library (with its path as specified in oldfile above). What am I doing wrong?
falling down the stairs
Upon further investigation, it appears that the entry in the Media Library only gets updated if it is also in a playlist. Is there any way to update an entry without adding it to a playlist first?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.