forked from openlp/openlp
Head
This commit is contained in:
commit
b75764f5f3
@ -629,7 +629,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
|||||||
self.song.alternate_title = unicode(self.AlternativeEdit.text())
|
self.song.alternate_title = unicode(self.AlternativeEdit.text())
|
||||||
self.song.copyright = unicode(self.CopyrightEditItem.text())
|
self.song.copyright = unicode(self.CopyrightEditItem.text())
|
||||||
self.song.search_title = self.song.title + u'@' + \
|
self.song.search_title = self.song.title + u'@' + \
|
||||||
unicode(self.AlternativeEdit.text())
|
self.song.alternate_title
|
||||||
self.song.comments = unicode(self.CommentsEdit.toPlainText())
|
self.song.comments = unicode(self.CommentsEdit.toPlainText())
|
||||||
self.song.verse_order = unicode(self.VerseOrderEdit.text())
|
self.song.verse_order = unicode(self.VerseOrderEdit.text())
|
||||||
self.song.ccli_number = unicode(self.CCLNumberEdit.text())
|
self.song.ccli_number = unicode(self.CCLNumberEdit.text())
|
||||||
@ -669,7 +669,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
|||||||
unicode(self.VerseListWidget.item(i, 0).text())) + u' '
|
unicode(self.VerseListWidget.item(i, 0).text())) + u' '
|
||||||
if (bits[1] > u'1') and (bits[0][0] not in multiple):
|
if (bits[1] > u'1') and (bits[0][0] not in multiple):
|
||||||
multiple.append(bits[0][0])
|
multiple.append(bits[0][0])
|
||||||
self.song.search_lyrics = text
|
self.song.search_lyrics = text.lower()
|
||||||
self.song.lyrics = unicode(sxml.extract_xml(), u'utf-8')
|
self.song.lyrics = unicode(sxml.extract_xml(), u'utf-8')
|
||||||
for verse in multiple:
|
for verse in multiple:
|
||||||
self.song.verse_order = re.sub(u'([' + verse.upper() +
|
self.song.verse_order = re.sub(u'([' + verse.upper() +
|
||||||
@ -682,4 +682,4 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
|||||||
def processTitle(self):
|
def processTitle(self):
|
||||||
log.debug(u'processTitle')
|
log.debug(u'processTitle')
|
||||||
self.song.search_title = re.sub(r'[\'"`,;:(){}?]+', u'',
|
self.song.search_title = re.sub(r'[\'"`,;:(){}?]+', u'',
|
||||||
unicode(self.song.search_title))
|
unicode(self.song.search_title)).lower()
|
||||||
|
@ -166,13 +166,13 @@ class SongMediaItem(MediaManagerItem):
|
|||||||
if search_type == 0:
|
if search_type == 0:
|
||||||
log.debug(u'Titles Search')
|
log.debug(u'Titles Search')
|
||||||
search_results = self.parent.manager.get_all_objects(Song,
|
search_results = self.parent.manager.get_all_objects(Song,
|
||||||
Song.search_title.like(u'%' + search_keywords + u'%'),
|
Song.search_title.like(u'%' + search_keywords.lower() + u'%'),
|
||||||
Song.search_title.asc())
|
Song.search_title.asc())
|
||||||
self.displayResultsSong(search_results)
|
self.displayResultsSong(search_results)
|
||||||
elif search_type == 1:
|
elif search_type == 1:
|
||||||
log.debug(u'Lyrics Search')
|
log.debug(u'Lyrics Search')
|
||||||
search_results = self.parent.manager.get_all_objects(Song,
|
search_results = self.parent.manager.get_all_objects(Song,
|
||||||
Song.search_lyrics.like(u'%' + search_keywords + u'%'),
|
Song.search_lyrics.like(u'%' + search_keywords.lower() + u'%'),
|
||||||
Song.search_lyrics.asc())
|
Song.search_lyrics.asc())
|
||||||
self.displayResultsSong(search_results)
|
self.displayResultsSong(search_results)
|
||||||
elif search_type == 2:
|
elif search_type == 2:
|
||||||
|
@ -55,6 +55,7 @@ class SongImport(QtCore.QObject):
|
|||||||
self.set_defaults()
|
self.set_defaults()
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'songs_stop_import'), self.stop_import)
|
QtCore.SIGNAL(u'songs_stop_import'), self.stop_import)
|
||||||
|
|
||||||
def set_defaults(self):
|
def set_defaults(self):
|
||||||
"""
|
"""
|
||||||
Create defaults for properties - call this before each song
|
Create defaults for properties - call this before each song
|
||||||
@ -262,8 +263,8 @@ class SongImport(QtCore.QObject):
|
|||||||
log.info(u'commiting song %s to database', self.title)
|
log.info(u'commiting song %s to database', self.title)
|
||||||
song = Song()
|
song = Song()
|
||||||
song.title = self.title
|
song.title = self.title
|
||||||
song.search_title = self.remove_punctuation(self.title) \
|
song.search_title = self.remove_punctuation(self.title).lower() \
|
||||||
+ '@' + self.alternate_title
|
+ '@' + self.remove_punctuation(self.alternate_title).lower()
|
||||||
song.song_number = self.song_number
|
song.song_number = self.song_number
|
||||||
song.search_lyrics = u''
|
song.search_lyrics = u''
|
||||||
verses_changed_to_other = {}
|
verses_changed_to_other = {}
|
||||||
@ -291,6 +292,7 @@ class SongImport(QtCore.QObject):
|
|||||||
versetag = newversetag
|
versetag = newversetag
|
||||||
sxml.add_verse_to_lyrics(versetype, versetag[1:], versetext)
|
sxml.add_verse_to_lyrics(versetype, versetag[1:], versetext)
|
||||||
song.search_lyrics += u' ' + self.remove_punctuation(versetext)
|
song.search_lyrics += u' ' + self.remove_punctuation(versetext)
|
||||||
|
song.search_lyrics = song.search_lyrics.lower()
|
||||||
song.lyrics = unicode(sxml.extract_xml(), u'utf-8')
|
song.lyrics = unicode(sxml.extract_xml(), u'utf-8')
|
||||||
for i, current_verse_tag in enumerate(self.verse_order_list):
|
for i, current_verse_tag in enumerate(self.verse_order_list):
|
||||||
if verses_changed_to_other.has_key(current_verse_tag):
|
if verses_changed_to_other.has_key(current_verse_tag):
|
||||||
|
@ -63,7 +63,7 @@ class SongsPlugin(Plugin):
|
|||||||
log.info(u'Songs Initialising')
|
log.info(u'Songs Initialising')
|
||||||
Plugin.initialise(self)
|
Plugin.initialise(self)
|
||||||
self.mediaItem.displayResultsSong(
|
self.mediaItem.displayResultsSong(
|
||||||
self.manager.get_all_objects(Song, order_by_ref=Song.title))
|
self.manager.get_all_objects(Song, order_by_ref=Song.search_title))
|
||||||
|
|
||||||
def getMediaManagerItem(self):
|
def getMediaManagerItem(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user