diff --git a/openlp/core/lib/db.py b/openlp/core/lib/db.py index f97a74dc8..972d849a3 100644 --- a/openlp/core/lib/db.py +++ b/openlp/core/lib/db.py @@ -199,7 +199,7 @@ class Manager(object): Any parameters to order the returned objects by. Defaults to None. """ query = self.session.query(object_class) - if filter_clause: + if filter_clause is not None: query = query.filter(filter_clause) if order_by_ref is not None: return query.order_by(order_by_ref).all() @@ -237,7 +237,7 @@ class Manager(object): """ try: query = self.session.query(object_class) - if filter_clause: + if filter_clause is not None: query = query.filter(filter_clause) query.delete(synchronize_session=False) self.session.commit() diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index 022acebcf..6ca9bd523 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -87,7 +87,7 @@ class ServiceItem(object): self.service_item_type = None self._raw_frames = [] self._display_frames = [] - self._uuid = unicode(uuid.uuid1()) + self._uuid = 0 self.notes = u'' self.from_plugin = False self.capabilities = [] @@ -98,6 +98,9 @@ class ServiceItem(object): self.footer = None self.bg_frame = None + def _new_item(self): + self._uuid = unicode(uuid.uuid1()) + def add_capability(self, capability): """ Add an ItemCapability to a ServiceItem @@ -188,6 +191,7 @@ class ServiceItem(object): self.service_item_type = ServiceItemType.Image self._raw_frames.append( {u'title': title, u'image': image, u'path': path}) + self._new_item() def add_from_text(self, title, raw_slide, verse_tag=None): """ @@ -203,6 +207,7 @@ class ServiceItem(object): title = title.split(u'\n')[0] self._raw_frames.append( {u'title': title, u'raw_slide': raw_slide, u'verseTag':verse_tag}) + self._new_item() def add_from_command(self, path, file_name, image): """ @@ -220,6 +225,7 @@ class ServiceItem(object): self.service_item_type = ServiceItemType.Command self._raw_frames.append( {u'title': file_name, u'image': image, u'path': path}) + self._new_item() def get_service_repr(self): """ diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index ced7f584e..f90136601 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -370,6 +370,6 @@ class SongMediaItem(MediaManagerItem): translate('SongsPlugin.MediaItem', 'CCLI Licence: ') + ccli)) service_item.raw_footer = raw_footer service_item.audit = [ - song.title, author_audit, song.copyright, song.ccli_number + song.title, author_audit, song.copyright, unicode(song.ccli_number) ] return True diff --git a/openlp/plugins/songusage/songusageplugin.py b/openlp/plugins/songusage/songusageplugin.py index 0ec82d15f..c8dfd06fc 100644 --- a/openlp/plugins/songusage/songusageplugin.py +++ b/openlp/plugins/songusage/songusageplugin.py @@ -109,7 +109,7 @@ class SongUsagePlugin(Plugin): log.info(u'SongUsage Initialising') Plugin.initialise(self) QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'songs_live_started'), + QtCore.SIGNAL(u'slidecontroller_live_started'), self.onReceiveSongUsage) self.SongUsageActive = QtCore.QSettings().value( self.settingsSection + u'/active', @@ -133,11 +133,11 @@ class SongUsagePlugin(Plugin): QtCore.QSettings().setValue(self.settingsSection + u'/active', QtCore.QVariant(self.SongUsageActive)) - def onReceiveSongUsage(self, items): + def onReceiveSongUsage(self, item): """ - SongUsage a live song from SlideController + Song Usage for live song from SlideController """ - audit = items[0].audit + audit = item[0].audit if self.SongUsageActive and audit: song_usage_item = SongUsageItem() song_usage_item.usagedate = datetime.today()