forked from openlp/openlp
Merge branch 'alpha-fixes5' into 'master'
Fix loading optical and streaming items from servicemanager. See merge request openlp/openlp!178
This commit is contained in:
commit
ca6ed027d3
@ -1,5 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
##########################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# ---------------------------------------------------------------------- #
|
||||
@ -43,6 +42,7 @@ from openlp.core.display.render import remove_tags, render_tags, render_chords_f
|
||||
from openlp.core.lib import ItemCapabilities
|
||||
from openlp.core.lib.theme import BackgroundType
|
||||
from openlp.core.ui.icons import UiIcons
|
||||
from openlp.core.ui.media import parse_stream_path
|
||||
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
@ -692,6 +692,11 @@ class ServiceItem(RegistryProperties):
|
||||
if not os.path.exists(slide['title']):
|
||||
self.is_valid = False
|
||||
break
|
||||
elif self.is_capable(ItemCapabilities.CanStream):
|
||||
(name, mrl, options) = parse_stream_path(slide['path'])
|
||||
if not name or not mrl or not options:
|
||||
self.is_valid = False
|
||||
break
|
||||
else:
|
||||
file_name = os.path.join(slide['path'], slide['title'])
|
||||
if not os.path.exists(file_name):
|
||||
|
@ -201,6 +201,8 @@ class MediaMediaItem(MediaManagerItem, RegistryProperties):
|
||||
service_item.will_auto_start = True
|
||||
# force a non-existent theme
|
||||
service_item.theme = -1
|
||||
# validate the item after all capabilities has been added
|
||||
service_item.validate_item()
|
||||
return True
|
||||
|
||||
def initialise(self):
|
||||
|
Loading…
Reference in New Issue
Block a user