Allow Songs to be Searched by Theme

This commit is contained in:
Tim Bentley 2010-12-23 17:51:32 +00:00
parent cc0af53b85
commit 67f6fceb0a

View File

@ -168,6 +168,8 @@ class SongMediaItem(MediaManagerItem):
translate('SongsPlugin.MediaItem', 'Lyrics'))
self.SearchTypeComboBox.addItem(
translate('SongsPlugin.MediaItem', 'Authors'))
self.SearchTypeComboBox.addItem(
translate('SongsPlugin.MediaItem', 'Themes'))
self.configUpdated()
def onSearchTextButtonClick(self):
@ -192,6 +194,12 @@ class SongMediaItem(MediaManagerItem):
Author.display_name.like(u'%' + search_keywords + u'%'),
Author.display_name.asc())
self.displayResultsAuthor(search_results)
elif search_type == 3:
log.debug(u'Theme Search')
search_results = self.parent.manager.get_all_objects(Song,
Song.theme_name.like(u'%' + search_keywords + u'%'),
Song.search_lyrics.asc())
self.displayResultsSong(search_results)
def onSongListLoad(self):
"""