Added starting and containing results individual sorting

This commit is contained in:
Dmitriy Shishkov 2025-03-25 00:02:52 +03:00
parent 96f7a83e1e
commit 79d58324de
Signed by: dm1sh
GPG Key ID: 027994B0AA357688
2 changed files with 8 additions and 6 deletions

View File

@ -157,14 +157,14 @@ class SearchPassService(dbus.service.Object):
path = path_join(dir_path, filename)[:-4]
password_list.append(path)
results = list(filter(lambda p: p.startswith(name), password_list))[:5]
results = list(sorted(filter(lambda p: p.startswith(name), password_list)))[:5]
remaining = 5 - len(results)
if remaining > 0:
containing_results = list(filter(lambda p: name in p, password_list))[
:remaining
]
containing_results = list(
sorted(filter(lambda p: name in p, password_list))
)[:remaining]
results.extend(containing_results)

View File

@ -1,10 +1,10 @@
Name: gnome-pass-search-provider
Version: 1.3.2
Version: 1.3.3
Release: %autorelease
Summary: Gnome Shell search provider for zx2c4/pass
License: GPL-3.0+
Url: https://git.dm1sh.ru/dm1sh/%{name}
Source0: https://git.dm1sh.ru/dm1sh/%{name}/archive/%{name}-%{version}.tar.gz
Source0: https://git.dm1sh.ru/dm1sh/%{name}/archive/%{version}.tar.gz
Requires: gnome-shell
Requires: pass
Requires: python3-gobject
@ -35,4 +35,6 @@ sed -i -e 's|LIBDIR=|LIBDIR=$RPM_BUILD_ROOT|' install.sh
* Mon Nov 13 2023 dm1sh <me@dmitriy.icu> 1.3.2-1
- new spec file
- package built with tito
* Tue Mar 25 2025 dm1sh <me@dmitriy.icu> 1.3.3
- Added starting and containing results individual sorting
%autochangelog