This commit is contained in:
Andreas Preikschat 2011-03-15 19:24:13 +01:00
parent 441283c6a0
commit bf4ecad9d1
4 changed files with 6 additions and 5 deletions

View File

@ -762,7 +762,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
item = self.topicsListView.item(row)
topicId = (item.data(QtCore.Qt.UserRole)).toInt()[0]
self.song.topics.append(self.manager.get_object(Topic, topicId))
clean_song(self.song)
clean_song(self.manager, self.song)
self.manager.save_object(self.song)
if not preview:
self.song = None

View File

@ -262,9 +262,8 @@ def clean_song(manager, song):
song.alternate_title = u''
song.alternate_title = song.alternate_title.strip()
whitespace = re.compile(r'\W+', re.UNICODE)
search_title = (whitespace.sub(u' ', song.title.lower()) +
u'@' + whitespace.sub(u' ', song.alternate_title.lower())).strip()
song.search_title = search_title if search_title else u''
song.search_title = (whitespace.sub(u' ', song.title.lower()) + u'@' +
whitespace.sub(u' ', song.alternate_title.lower())).strip()
# Remove the "language" attribute from lyrics tag. This is not very
# important, but this keeps the database clean. This can be removed
# when everybody has cleaned his songs.

View File

@ -254,6 +254,8 @@ class SongImport(QtCore.QObject):
song.title = self.title
song.alternate_title = self.alternate_title
song.search_title = u''
song.search_lyrics = u''
song.verse_order = u''
song.song_number = self.song_number
verses_changed_to_other = {}
sxml = SongXML()
@ -279,7 +281,6 @@ class SongImport(QtCore.QObject):
if verses_changed_to_other.has_key(current_verse_def):
self.verse_order_list[i] = \
verses_changed_to_other[current_verse_def]
song.search_lyrics = u''
song.verse_order = u' '.join(self.verse_order_list)
song.copyright = self.copyright
song.comments = self.comments

View File

@ -305,6 +305,7 @@ class OpenLyrics(object):
# Values will be set when cleaning the song.
song.search_lyrics = u''
song.verse_order = u''
song.search_title = u''
self._process_copyright(properties, song)
self._process_cclinumber(properties, song)
self._process_titles(properties, song)