- container_titles = video.get('container', {}).get('titles')
- if container_titles:
- container_title = container_titles.get('en') or container_titles[container_titles.keys()[0]]
- title = '%s - %s' % (container_title, title)
-
- descriptions = video.get('descriptions', {})
- description = descriptions.get('en')
- if description is None:
- filtered_descriptions = list(filter(None, [descriptions.get(k) for k in titles.keys()]))
- if filtered_descriptions:
- description = filtered_descriptions[0]
+ container_titles = video.get('container', {}).get('titles', {})
+ container_title = self.dict_selection(container_titles, 'en')
+ title = '%s - %s' % (container_title, title)
+
+ description = self.dict_selection(video.get('descriptions', {}), 'en')