[appimage] improvements -> database files only updated when expired

This commit is contained in:
Vinicius Moreira
2020-12-23 13:39:58 -03:00
parent 5e8265817f
commit adfb265dc3
18 changed files with 301 additions and 232 deletions

View File

@@ -28,6 +28,10 @@ class SearchResult:
self.new = new
self.total = total
@classmethod
def empty(cls):
return cls(installed=[], new=[], total=0)
class UpgradeRequirement:
@@ -116,7 +120,7 @@ class SoftwareManager(ABC):
pass
@abstractmethod
def read_installed(self, disk_loader: Optional[DiskCacheLoader], limit: int, only_apps: bool, pkg_types: Set[Type[SoftwarePackage]], internet_available: bool) -> SearchResult:
def read_installed(self, disk_loader: Optional[DiskCacheLoader], limit: int, only_apps: bool, pkg_types: Optional[Set[Type[SoftwarePackage]]], internet_available: bool) -> SearchResult:
"""
:param disk_loader: a running disk loader thread that loads application data from the disk asynchronously
:param limit: the max number of packages to be retrieved. <= 1 should retrieve everything