add basic timer add support
[enigma2-plugins.git] / webinterface / src / WebComponents / Sources / Movie.py
1 from enigma import *
2 from enigma import eServiceReference, iServiceInformation
3 from Components.Sources.Source import Source
4 from ServiceReference import ServiceReference
5 from Components.MovieList import MovieList
6 from Tools.Directories import *
7 class Movie( Source):
8     
9     def __init__(self, session):
10         Source.__init__(self)        
11         self.session = session
12         self.root = eServiceReference("2:0:1:0:0:0:0:0:0:0:" + resolveFilename(SCOPE_HDD))
13         self.movielist = MovieList(self.root)
14         self.movielist.load(self.root,None)
15         
16     def command(self):
17         self.movielist.reload(root=self.root)
18         list=[]
19         for (serviceref, info, begin,unknown) in self.movielist.list:
20             movie = []
21             movie.append(serviceref.toString())
22             movie.append(ServiceReference(serviceref).getServiceName())
23             movie.append(info.getInfoString(serviceref, iServiceInformation.sDescription))
24             #movie.append("eventdaten")#info.getEvent(serviceref).getExtendedDescription())
25             
26             sourceERef =info.getInfoString(serviceref, iServiceInformation.sServiceref)
27             sourceRef= ServiceReference(sourceERef)
28             #sourceInfo= sourceRef and sourceRef.info()
29             
30             movie.append(sourceRef.getServiceName())
31             #movie.append("")#sourceInfo.getInfo(sourceRef,iServiceInformation.sProvider))
32             
33             #movie.append("x")
34             #movie.append("y")
35             movie.append(info.getInfoString(serviceref, iServiceInformation.sTags))
36             list.append(movie)
37         print "tags",self.movielist.tags
38         return list
39         
40     list = property(command)
41     lut = {"ServiceReference": 0
42            ,"Title": 1
43            ,"Description": 2
44            ,"ServiceName": 3
45            ,"Tags": 4
46            }
47