From 7a477d62f1a7563ca5df5650bde07ea895e3ef9d Mon Sep 17 00:00:00 2001 From: Plom Heller Date: Sat, 18 Apr 2026 05:58:14 +0200 Subject: [PATCH] Add .last_mod_time, .name to attributes allowing filtering. --- browser/gallery_config.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/browser/gallery_config.py b/browser/gallery_config.py index 18bc3af..cbd77ab 100644 --- a/browser/gallery_config.py +++ b/browser/gallery_config.py @@ -17,6 +17,9 @@ gi.require_version('Gio', '2.0') from gi.repository import Gio, GObject, Gtk, Pango # type: ignore # noqa: E402 +ALWAYS_ORDERS = ['bookmarked', 'last_mod_time', 'name'] + + class SorterAndFilterer(GObject.GObject): """Sort order box representation of sorting/filtering attribute.""" widget: Gtk.Box @@ -147,7 +150,7 @@ class SorterAndFiltererOrder: @classmethod def from_suggestion(cls, suggestion: list[str]) -> Self: """Create new, interpreting order of strings in suggestion.""" - names: list[str] = [p.lower() for p in GEN_PARAMS] + ['bookmarked'] + names: list[str] = [p.lower() for p in GEN_PARAMS] + ALWAYS_ORDERS order: list[SorterAndFilterer] = [] for name in names: order += [SorterAndFilterer(name)] -- 2.30.2