mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-09 07:34:16 +02:00
[fix][web] some installed apps were not being displayed as installed in the search results
This commit is contained in:
@@ -13,11 +13,12 @@ class WebApplication(SoftwarePackage):
|
||||
def __init__(self, id: str = None, url: str = None, name: str = None, description: str = None, icon_url: str = None,
|
||||
installation_dir: str = None, desktop_entry: str = None, installed: bool = False, version: str = None,
|
||||
categories: List[str] = None, custom_icon: str = None, preset_options: List[str] = None, save_icon: bool = True,
|
||||
options_set: List[str] = None, package_name: str = None):
|
||||
options_set: List[str] = None, package_name: str = None, source_url: str = None):
|
||||
super(WebApplication, self).__init__(id=id if id else url, name=name, description=description,
|
||||
icon_url=icon_url, installed=installed, version=version,
|
||||
categories=categories)
|
||||
self.url = url
|
||||
self.source_url = source_url if source_url else url
|
||||
self.installation_dir = installation_dir
|
||||
self.desktop_entry = desktop_entry
|
||||
self.set_custom_icon(custom_icon)
|
||||
@@ -26,6 +27,12 @@ class WebApplication(SoftwarePackage):
|
||||
self.options_set = options_set
|
||||
self.package_name = package_name
|
||||
|
||||
def get_source_url(self):
|
||||
if self.source_url:
|
||||
return self.source_url
|
||||
|
||||
return self.url
|
||||
|
||||
def set_version(self, version: str):
|
||||
self.version = str(version) if version else None
|
||||
self.latest_version = version
|
||||
@@ -39,7 +46,7 @@ class WebApplication(SoftwarePackage):
|
||||
@staticmethod
|
||||
def _get_cached_attrs() -> tuple:
|
||||
return 'id', 'name', 'version', 'url', 'description', 'icon_url', 'installation_dir', \
|
||||
'desktop_entry', 'categories', 'custom_icon', 'options_set', 'save_icon', 'package_name'
|
||||
'desktop_entry', 'categories', 'custom_icon', 'options_set', 'save_icon', 'package_name', 'source_url'
|
||||
|
||||
def can_be_downgraded(self):
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user