Translate Database path to file location

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
tmacreturns Offline
Junior Member
Posts: 34
Joined: Aug 2011
Reputation: 0
Location: The Netherlands
Post: #1
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
find quote
spiff Offline
Retired Developer
Posts: 12,386
Joined: Nov 2003
Post: #2
the video tag of the item has the real path.
find quote
tmacreturns Offline
Junior Member
Posts: 34
Joined: Aug 2011
Reputation: 0
Location: The Netherlands
Post: #3
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
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 25,694
Joined: Oct 2003
Reputation: 169
Post: #4
See xbmc/filesystem/FileMusicDatabase.cpp or thereabouts.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote