forked from openlp/openlp
fixed duplication
This commit is contained in:
parent
a031784146
commit
044f0c88e7
@ -262,8 +262,8 @@ def clean_song(manager, song):
|
|||||||
song.alternate_title = u''
|
song.alternate_title = u''
|
||||||
song.alternate_title = song.alternate_title.strip()
|
song.alternate_title = song.alternate_title.strip()
|
||||||
whitespace = re.compile(r'\W+', re.UNICODE)
|
whitespace = re.compile(r'\W+', re.UNICODE)
|
||||||
song.search_title = (whitespace.sub(u' ', song.title.lower()) + u'@' +
|
song.search_title = (whitespace.sub(u' ', song.title).strip() + u'@' +
|
||||||
whitespace.sub(u' ', song.alternate_title.lower())).strip()
|
whitespace.sub(u' ', song.alternate_title).strip()).strip().lower()
|
||||||
# Remove the "language" attribute from lyrics tag. This is not very
|
# Remove the "language" attribute from lyrics tag. This is not very
|
||||||
# important, but this keeps the database clean. This can be removed
|
# important, but this keeps the database clean. This can be removed
|
||||||
# when everybody has cleaned his songs.
|
# when everybody has cleaned his songs.
|
||||||
|
@ -423,7 +423,7 @@ class SongMediaItem(MediaManagerItem):
|
|||||||
# should work for songs without alternate title.
|
# should work for songs without alternate title.
|
||||||
search_results = self.parent.manager.get_all_objects(Song,
|
search_results = self.parent.manager.get_all_objects(Song,
|
||||||
Song.search_title == (re.compile(r'\W+', re.UNICODE).sub(u' ',
|
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())
|
Song.search_title.asc())
|
||||||
else:
|
else:
|
||||||
search_results = self.parent.manager.get_all_objects(Song,
|
search_results = self.parent.manager.get_all_objects(Song,
|
||||||
|
Loading…
Reference in New Issue
Block a user