get path location of movie
#1
Hi

Sorry for second topic.
How can I get current movie which I want to play (path and filename) by xbmc?
I would like to use this value in my python code.
In java I have method getSelection. Where can I find methods descriptions of xbmc/xbmcgui?

Plesken
Reply
#2
http://passion-xbmc.org/index.php?page=python
Reply
#3
ppic Wrote:http://passion-xbmc.org/index.php?page=python

Thanks for your answer. BTW I have found another way to get currently playing movie:

Code:
#!/usr/bin/python
# -*- coding: utf-8 -*-

import string, re
import os
import sqlite3

databasepath = ''
listTable = os.listdir(os.getenv("HOME") + '/.xbmc/userdata/Database')
sizelist = len(listTable)
for i in range(sizelist):
  if 'MyVideos' in listTable[i]:
    databasepath = os.getenv("HOME") + '/.xbmc/userdata/Database/' + listTable[i]

print(databasepath)
conn = sqlite3.connect(databasepath)
c = conn.cursor()
movie = c.execute('SELECT path.strPath || files.strFileName FROM path, files WHERE path.idPath = files.idPath ORDER BY files.lastPlayed DESC LIMIT 1')

print(movie.fetchone()[0])

c.close()

It's working Smile but only outside of xbmc. I checked it again :-(
Is anobody person who can explain me how I can get full path selected movie from main gui dialog?
I would like to do action when I click/open movie then display select window with options. After I select option play a movie.
I did automatically open select window by edit keymap.xml. The problem is when I click on buttom of select window, because I can not get path of selected movie to play :-(. I have read lots documentations and I didn't find any to solve my problem.
Reply

Logout Mark Read Team Forum Stats Members Help
get path location of movie0