Kodi Community Forum
Translate Database path to file location - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93)
+--- Thread: Translate Database path to file location (/showthread.php?tid=126308)



Translate Database path to file location - tmacreturns - 2012-03-23

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


RE: Translate Database path to file location - spiff - 2012-03-23

the video tag of the item has the real path.


RE: Translate Database path to file location - tmacreturns - 2012-03-26

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


RE: Translate Database path to file location - jmarshall - 2012-03-26

See xbmc/filesystem/FileMusicDatabase.cpp or thereabouts.