Kodi Community Forum

Full Version: Translate Database path to file location
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all,

I am developing an add-on and I am integrating it into the XBMC code. The main idea consists on uploading a file to a certain WebServer. I pass the path to the file, which I get via CFileItemPtr->GetPath(), to the python script. This was working fine until I run into the case where GetPath is returning the Database index for, for instance, the movie I am displaying on the Video Navigation window.

The problem is that I cannot upload a file if I have the path like ""videodb:/1/23/ ...", but I rather need something like a local path, i.e. "C:/Documents/Movie.mkv". I've been browsing through the C++ code and the Python xbmc modules, but I can't find a proper function to obtain the Path from the database, or if there is an actual function that would return the local path instead of the database indexes.

Does anybody have an idea about how to get the actual path to the file rather than the database index? It does not matter if in C++ (which I believe more plausible) or in Python ( which would be indeed faster and easier, but more unlikely)

Thanks in advance,

Efren
the video tag of the item has the real path.
Thanks for the fast response spiff!! I am sorry to be so persistent on the same problem, but I can't see the same solution using the Music Tag, anybody has any idea?

Thanks in advance
See xbmc/filesystem/FileMusicDatabase.cpp or thereabouts.