mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 01:14:15 +02:00
[appimage] improvement: always setting attributes not available for database installed applications (search)
This commit is contained in:
@@ -79,6 +79,7 @@ class AppImageManager(SoftwareManager):
|
|||||||
self.file_downloader = context.file_downloader
|
self.file_downloader = context.file_downloader
|
||||||
self.configman = AppImageConfigManager()
|
self.configman = AppImageConfigManager()
|
||||||
self._custom_actions: Optional[Iterable[CustomSoftwareAction]] = None
|
self._custom_actions: Optional[Iterable[CustomSoftwareAction]] = None
|
||||||
|
self._search_unfilled_attrs: Optional[Tuple[str, ...]] = None
|
||||||
|
|
||||||
def install_file(self, root_password: Optional[str], watcher: ProcessWatcher) -> bool:
|
def install_file(self, root_password: Optional[str], watcher: ProcessWatcher) -> bool:
|
||||||
file_chooser = FileChooserComponent(label=self.i18n['file'].capitalize(),
|
file_chooser = FileChooserComponent(label=self.i18n['file'].capitalize(),
|
||||||
@@ -217,6 +218,11 @@ class AppImageManager(SoftwareManager):
|
|||||||
new_found = found_map.get(key)
|
new_found = found_map.get(key)
|
||||||
|
|
||||||
if new_found:
|
if new_found:
|
||||||
|
if not appim.imported:
|
||||||
|
for attr in self.search_unfilled_attrs:
|
||||||
|
if getattr(appim, attr) is None:
|
||||||
|
setattr(appim, attr, getattr(new_found['app'], attr))
|
||||||
|
|
||||||
del not_installed[new_found['idx']]
|
del not_installed[new_found['idx']]
|
||||||
installed_found.append(appim)
|
installed_found.append(appim)
|
||||||
found = True
|
found = True
|
||||||
@@ -936,3 +942,12 @@ class AppImageManager(SoftwareManager):
|
|||||||
|
|
||||||
res = db_updater.download_databases()
|
res = db_updater.download_databases()
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
@property
|
||||||
|
def search_unfilled_attrs(self) -> Tuple[str, ...]:
|
||||||
|
if self._search_unfilled_attrs is None:
|
||||||
|
self._search_unfilled_attrs = ('icon_url', 'url_download_latest_version', 'author', 'license', 'github',
|
||||||
|
'source', 'url_screenshot')
|
||||||
|
|
||||||
|
return self._search_unfilled_attrs
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user