mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 08:14:16 +02:00
Merge branch 'staging' into modules
# Conflicts: # fpakman/core/controller.py
This commit is contained in:
@@ -22,7 +22,7 @@ class GenericApplicationManager(ApplicationManager):
|
||||
|
||||
def _sort(self, apps: List[Application], word: str) -> List[Application]:
|
||||
|
||||
exact_name_matches, contains_name_matches, desc_name_matches, others = [], [], [], []
|
||||
exact_name_matches, contains_name_matches, others = [], [], []
|
||||
|
||||
for app in apps:
|
||||
lower_name = app.base_data.name.lower()
|
||||
@@ -31,13 +31,11 @@ class GenericApplicationManager(ApplicationManager):
|
||||
exact_name_matches.append(app)
|
||||
elif word in lower_name:
|
||||
contains_name_matches.append(app)
|
||||
elif app.base_data.description and word in app.base_data.description.lower():
|
||||
desc_name_matches.append(app)
|
||||
else:
|
||||
others.append(app)
|
||||
|
||||
res = []
|
||||
for app_list in (exact_name_matches, contains_name_matches, desc_name_matches, others):
|
||||
for app_list in (exact_name_matches, contains_name_matches, others):
|
||||
app_list.sort(key=lambda a: a.base_data.name.lower())
|
||||
res.extend(app_list)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user