added SongBook name, Song Number and Alternative Title to Entire Search

Fixes: https://launchpad.net/bugs/1695587
This commit is contained in:
Johannes Thomas Meyer 2017-06-03 12:44:28 +02:00
parent 81492013ed
commit e6d4857c81
1 changed files with 7 additions and 3 deletions

View File

@ -231,9 +231,13 @@ class SongMediaItem(MediaManagerItem):
def search_entire(self, search_keywords):
search_string = '%{text}%'.format(text=clean_string(search_keywords))
return self.plugin.manager.get_all_objects(
Song, or_(Song.search_title.like(search_string), Song.search_lyrics.like(search_string),
Song.comments.like(search_string)))
return (self.plugin.manager.session.query(Song)
.join(SongBookEntry, isouter=True)
.join(Book, isouter=True)
.filter(or_(Book.name.like(search_string), SongBookEntry.entry.like(search_string),
Song.search_title.like(search_string), Song.search_lyrics.like(search_string),
Song.comments.like(search_string), Song.alternate_title.like(search_string)))
.all())
def on_song_list_load(self):
"""