git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git.opendreambox.org:/git/enigma2
[enigma2.git]
/
lib
/
python
/
Plugins
/
Extensions
/
MediaPlayer
/
plugin.py
diff --git
a/lib/python/Plugins/Extensions/MediaPlayer/plugin.py
b/lib/python/Plugins/Extensions/MediaPlayer/plugin.py
index 607294bafd511b7ba8544f25459550fd0060dcee..3e02384122a8826c0f9f820abf57017f1ddee89f 100644
(file)
--- a/
lib/python/Plugins/Extensions/MediaPlayer/plugin.py
+++ b/
lib/python/Plugins/Extensions/MediaPlayer/plugin.py
@@
-44,6
+44,7
@@
class MediaPixmap(Pixmap):
def applySkin(self, desktop, screen):
from Tools.LoadPixmap import LoadPixmap
def applySkin(self, desktop, screen):
from Tools.LoadPixmap import LoadPixmap
+ noCoverFile = None
if self.skinAttributes is not None:
for (attrib, value) in self.skinAttributes:
if attrib == "pixmap":
if self.skinAttributes is not None:
for (attrib, value) in self.skinAttributes:
if attrib == "pixmap":
@@
-110,7
+111,7
@@
class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB
# 'None' is magic to start at the list of mountpoints
defaultDir = config.mediaplayer.defaultDir.getValue()
# 'None' is magic to start at the list of mountpoints
defaultDir = config.mediaplayer.defaultDir.getValue()
- self.filelist = FileList(defaultDir, matchingPattern = "(?i)^.*\.(mp2|mp3|ogg|ts|wav|wave|m3u|pls|e2pls|mpg|vob|avi|
mkv|mp4
|dat|flac)", useServiceRef = True, additionalExtensions = "4098:m3u 4098:e2pls 4098:pls")
+ self.filelist = FileList(defaultDir, matchingPattern = "(?i)^.*\.(mp2|mp3|ogg|ts|wav|wave|m3u|pls|e2pls|mpg|vob|avi|
divx|mkv|mp4|m4a
|dat|flac)", useServiceRef = True, additionalExtensions = "4098:m3u 4098:e2pls 4098:pls")
self["filelist"] = self.filelist
self.playlist = MyPlayList()
self["filelist"] = self.filelist
self.playlist = MyPlayList()
@@
-122,15
+123,15
@@
class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB
self["currenttext"] = Label("")
self["currenttext"] = Label("")
- self["artisttext"] = Label(_("Artist
:")
)
+ self["artisttext"] = Label(_("Artist
")+':'
)
self["artist"] = Label("")
self["artist"] = Label("")
- self["titletext"] = Label(_("Title
:")
)
+ self["titletext"] = Label(_("Title
")+':'
)
self["title"] = Label("")
self["title"] = Label("")
- self["albumtext"] = Label(_("Album
:")
)
+ self["albumtext"] = Label(_("Album
")+':'
)
self["album"] = Label("")
self["album"] = Label("")
- self["yeartext"] = Label(_("Year
:")
)
+ self["yeartext"] = Label(_("Year
")+':'
)
self["year"] = Label("")
self["year"] = Label("")
- self["genretext"] = Label(_("Genre
:")
)
+ self["genretext"] = Label(_("Genre
")+':'
)
self["genre"] = Label("")
self["coverArt"] = MediaPixmap()
self["repeat"] = MultiPixmap()
self["genre"] = Label("")
self["coverArt"] = MediaPixmap()
self["repeat"] = MultiPixmap()
@@
-658,12
+659,16
@@
class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB
def copyDirectory(self, directory, recursive = True):
print "copyDirectory", directory
def copyDirectory(self, directory, recursive = True):
print "copyDirectory", directory
- filelist = FileList(directory, useServiceRef = True, isTop = True)
+ if directory == '/':
+ print "refusing to operate on /"
+ return
+ filelist = FileList(directory, useServiceRef = True, showMountpoints = False, isTop = True)
for x in filelist.getFileList():
if x[0][1] == True: #isDir
if recursive:
for x in filelist.getFileList():
if x[0][1] == True: #isDir
if recursive:
- self.copyDirectory(x[0][0])
+ if x[0][0] != directory:
+ self.copyDirectory(x[0][0])
elif filelist.getServiceRef() and filelist.getServiceRef().type == 4097:
self.playlist.addFile(x[0][0])
self.playlist.updateList()
elif filelist.getServiceRef() and filelist.getServiceRef().type == 4097:
self.playlist.addFile(x[0][0])
self.playlist.updateList()
@@
-804,6
+809,7
@@
class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB
def playEntry(self):
if len(self.playlist.getServiceRefList()):
def playEntry(self):
if len(self.playlist.getServiceRefList()):
+ audio_extensions = (".mp2", ".mp3", ".wav", ".ogg", "flac", "m4a")
needsInfoUpdate = False
currref = self.playlist.getServiceRefList()[self.playlist.getCurrentIndex()]
if self.session.nav.getCurrentlyPlayingServiceReference() is None or currref != self.session.nav.getCurrentlyPlayingServiceReference():
needsInfoUpdate = False
currref = self.playlist.getServiceRefList()[self.playlist.getCurrentIndex()]
if self.session.nav.getCurrentlyPlayingServiceReference() is None or currref != self.session.nav.getCurrentlyPlayingServiceReference():
@@
-819,7
+825,7
@@
class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB
ext = text[-4:].lower()
# FIXME: the information if the service contains video (and we should hide our window) should com from the service instead
ext = text[-4:].lower()
# FIXME: the information if the service contains video (and we should hide our window) should com from the service instead
- if ext not in
[".mp2", ".mp3", ".wav", ".ogg", "flac"]
and not self.isAudioCD:
+ if ext not in
audio_extensions
and not self.isAudioCD:
self.hide()
else:
needsInfoUpdate = True
self.hide()
else:
needsInfoUpdate = True
@@
-846,7
+852,7
@@
class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB
currref = self.playlist.getServiceRefList()[idx]
text = currref.getPath()
ext = text[-4:].lower()
currref = self.playlist.getServiceRefList()[idx]
text = currref.getPath()
ext = text[-4:].lower()
- if ext not in
[".mp2", ".mp3", ".wav", ".ogg", "flac"]
and not self.isAudioCD:
+ if ext not in
audio_extensions
and not self.isAudioCD:
self.hide()
else:
needsInfoUpdate = True
self.hide()
else:
needsInfoUpdate = True