1
0
mirror of https://gitlab.com/openlp/openlp.git synced 2024-10-31 16:54:40 +00:00

fixed duplication

This commit is contained in:
Andreas Preikschat 2011-03-16 16:37:56 +01:00
parent a031784146
commit 044f0c88e7
2 changed files with 3 additions and 3 deletions

View File

@ -262,8 +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)
song.search_title = (whitespace.sub(u' ', song.title.lower()) + u'@' +
whitespace.sub(u' ', song.alternate_title.lower())).strip()
song.search_title = (whitespace.sub(u' ', song.title).strip() + u'@' +
whitespace.sub(u' ', song.alternate_title).strip()).strip().lower()
# 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

@ -423,7 +423,7 @@ class SongMediaItem(MediaManagerItem):
# should work for songs without alternate title.
search_results = self.parent.manager.get_all_objects(Song,
Song.search_title == (re.compile(r'\W+', re.UNICODE).sub(u' ',
item.data_string[u'title'].strip()) + u'@'),
item.data_string[u'title'].strip()) + u'@').strip().lower(),
Song.search_title.asc())
else:
search_results = self.parent.manager.get_all_objects(Song,