diff --git a/trackma/lib/libanilist.py b/trackma/lib/libanilist.py index 9470375b..e7a73d2b 100644 --- a/trackma/lib/libanilist.py +++ b/trackma/lib/libanilist.py @@ -388,6 +388,7 @@ def search(self, criteria, method): genres synonyms averageScore + studios(sort: NAME, isMain: true) { nodes { name } } } } }''' @@ -421,6 +422,7 @@ def request_info(self, itemlist): genres synonyms averageScore + studios(sort: NAME, isMain: true) { nodes { name } } } }''' @@ -458,14 +460,12 @@ def _parse_info(self, item): ('Romaji', item['title'].get('romaji')), ('Japanese', item['title'].get('native')), ('Synonyms', item['title'].get('synonyms')), - #('Classification', item.get('classification')), ('Genres', item.get('genres')), + ('Studios', [s['name'] for s in item['studios']['nodes']]), ('Synopsis', item.get('description')), ('Type', item.get('format')), ('Average score', item.get('averageScore')), ('Status', self.status_translate[item['status']]), - #('Start Date', item.get('start_date')), - #('End Date', item.get('end_date')), ] }) return info diff --git a/trackma/ui/qt/widgets.py b/trackma/ui/qt/widgets.py index 9d860e7f..82536a55 100644 --- a/trackma/ui/qt/widgets.py +++ b/trackma/ui/qt/widgets.py @@ -116,18 +116,18 @@ def s_show_image(self, filename): def r_details_loaded(self, result): if result['success']: details = result['details'] + print(repr(details)) info_strings = [] description_strings = [] description_keys = {'Synopsis', 'English', 'Japanese', 'Synonyms'} # This might come down to personal preference - list_keys = {'Genres'} # Anilist gives genres as a list, need a special case to fix formatting for line in details['extra']: if line[0] and line[1]: if line[0] in description_keys: description_strings.append( "
%s
" % (line[0], line[1]) ) else: - if line[0] in list_keys: + if isinstance(line[1], list): description_strings.append( "%s
" % (line[0], ', '.join(line[1])) ) elif len("%s" % line[1]) >= 17: # Avoid short tidbits taking up too much vertical space info_strings.append( "%s
" % (line[0], line[1]) )