add category property for search results (closes #229)

This commit is contained in:
sigma67 2021-10-03 13:25:50 +02:00
commit c536720e6e
No known key found for this signature in database
GPG key ID: 1545A01D4474BAF0
2 changed files with 12 additions and 5 deletions

View file

@ -9,12 +9,12 @@ class Parser:
self.lang = language
@i18n
def parse_search_results(self, results, resultType=None):
def parse_search_results(self, results, resultType=None, category=None):
search_results = []
default_offset = (not resultType) * 2
for result in results:
data = result[MRLIR]
search_result = {}
search_result = {'category': category}
if not resultType:
resultType = get_item_text(data, 1).lower()
result_types = ['artist', 'playlist', 'song', 'video', 'station']