~larryprice/libertine-scope/libertine-store-open-apps

« back to all changes in this revision

Viewing changes to service/libertine_service/appstream.py

merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
                                package["summary"] = xstr(component.get_summary())
41
41
                                package["uri"] = xstr(component.get_url(AppStream.UrlKind.HOMEPAGE))
42
42
                                package['package'] = ' '.join(component.get_pkgnames())
43
 
                                package["rating"] = 0
44
43
 
45
44
                                if len(component.get_icons()) > 0:
46
45
                                        package["icon"] = xstr(self._get_largest_icon(component.get_icons()).get_filename())
56
55
                        app_data["id"] = xstr(app.get_id())
57
56
                        app_data["summary"] = xstr(app.get_summary())
58
57
                        app_data["website"] = xstr(app.get_url(AppStream.UrlKind.HOMEPAGE))
59
 
                        app_data["rating"] = 0
60
58
                        app_data["license"] = xstr(app.get_project_license())
61
59
                        app_data['package'] = ' '.join(app.get_pkgnames())
62
60
                        for screenshot in app.get_screenshots():
73
71
                                app_data["icon"] = xstr(self._get_largest_icon(app.get_icons()).get_filename())
74
72
 
75
73
                return app_data
76
 
 
77
 
        def _get_largest_icon(self, images):
78
 
                largest = None
79
 
                for icon in images:
80
 
                        if largest is None or icon.get_width() > largest.get_width():
81
 
                                largest = icon
82
 
                return largest