From 2cd670fcfe926db04e7be4b2a105eff6dc2c7078 Mon Sep 17 00:00:00 2001 From: kramo Date: Fri, 20 Oct 2023 15:28:33 +0200 Subject: [PATCH] Ignore 'the' prefix when sorting - fixes #204 --- cartridges/window.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cartridges/window.py b/cartridges/window.py index 73139fa..9828d40 100644 --- a/cartridges/window.py +++ b/cartridges/window.py @@ -413,9 +413,11 @@ class CartridgesWindow(Adw.ApplicationWindow): order = False def get_value(index: int) -> str: - return str( - getattr((child1.get_child(), child2.get_child())[index], var) - ).lower() + return ( + str(getattr((child1.get_child(), child2.get_child())[index], var)) + .lower() + .removeprefix("the ") + ) if var != "name" and get_value(0) == get_value(1): var, order = "name", False