openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #06465
[Merge] lp:~mahfiaz/openlp/fixes_and_improvements into lp:openlp
mahfiaz has proposed merging lp:~mahfiaz/openlp/fixes_and_improvements into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
For more details, see:
https://code.launchpad.net/~mahfiaz/openlp/fixes_and_improvements/+merge/50702
Add more detailed mimetype logging, so that logs would be useful when filling that mimetypes dictionary.
--
https://code.launchpad.net/~mahfiaz/openlp/fixes_and_improvements/+merge/50702
Your team OpenLP Core is requested to review the proposed merge of lp:~mahfiaz/openlp/fixes_and_improvements into lp:openlp.
=== modified file 'openlp/plugins/media/lib/mediaitem.py'
--- openlp/plugins/media/lib/mediaitem.py 2011-02-20 18:12:55 +0000
+++ openlp/plugins/media/lib/mediaitem.py 2011-02-22 07:03:00 +0000
@@ -61,8 +61,8 @@
self.onNewPrompt = translate('MediaPlugin.MediaItem', 'Select Media')
self.onNewFileMasks = unicode(translate('MediaPlugin.MediaItem',
'Videos (%s);;Audio (%s);;%s (*)')) % (
- u' '.join(self.parent.video_list),
- u' '.join(self.parent.audio_list), UiStrings.AllFiles)
+ u' '.join(self.parent.video_extensions_list),
+ u' '.join(self.parent.audio_extensions_list), UiStrings.AllFiles)
self.replaceAction.setText(UiStrings.ReplaceBG)
self.replaceAction.setToolTip(UiStrings.ReplaceLiveBG)
self.resetAction.setText(UiStrings.ResetBG)
=== modified file 'openlp/plugins/media/mediaplugin.py'
--- openlp/plugins/media/mediaplugin.py 2011-02-20 18:49:59 +0000
+++ openlp/plugins/media/mediaplugin.py 2011-02-22 07:03:00 +0000
@@ -45,28 +45,36 @@
self.icon = build_icon(self.icon_path)
# passed with drag and drop messages
self.dnd_id = u'Media'
- self.audio_list = []
- self.video_list = []
+ # This is yet a dummy example:
+ self.additional_extensions = {
+ 'video/msvideo': ['.avi']} # only an example line, unnecessary
+ self.audio_extensions_list = []
+ self.video_extensions_list = []
mimetypes.init()
for mimetype in Phonon.BackendCapabilities.availableMimeTypes():
mimetype = unicode(mimetype)
if mimetype.startswith(u'audio/'):
- self._addToList(self.audio_list, mimetype)
+ self._addToList(self.audio_extensions_list, mimetype)
elif mimetype.startswith(u'video/'):
- self._addToList(self.video_list, mimetype)
- log.info(u'MediaPlugin handles audio extensions: %s',
- u' '.join(self.audio_list))
- log.info(u'MediaPlugin handles video extensions: %s',
- u' '.join(self.video_list))
+ self._addToList(self.video_extensions_list, mimetype)
def _addToList(self, list, mimetype):
- # Is it a media type
extensions = mimetypes.guess_all_extensions(unicode(mimetype))
for extension in extensions:
ext = u'*%s' % extension
if ext not in list:
list.append(ext)
self.serviceManager.supportedSuffixes(extension[1:])
+ log.info(u'MediaPlugin: %s extensions: %s' % (mimetype,
+ u' '.join(extensions)))
+ if mimetype in self.additional_extensions.keys():
+ for extension in self.additional_extensions[mimetype]:
+ ext = u'*%s' % extensions
+ if ext not in list:
+ list.append(ext)
+ self.serviceManager.supportedSuffixes(extension[1:])
+ log.info(u'MediaPlugin: %s additional extensions: %s' % (mimetype,
+ u' '.join(self.additional_extensions[mimetype])))
def about(self):
about_text = translate('MediaPlugin', '<strong>Media Plugin</strong>'
Follow ups