diff --git a/qutebrowser/completion/models/urlmodel.py b/qutebrowser/completion/models/urlmodel.py index 9e2571848..b106da366 100644 --- a/qutebrowser/completion/models/urlmodel.py +++ b/qutebrowser/completion/models/urlmodel.py @@ -75,9 +75,9 @@ def url(): columns_to_filter=[0, 1])) timefmt = config.get('completion', 'timestamp-format') - select_time = "strftime('{}', max(atime), 'unixepoch')".format(timefmt) + select_time = "strftime('{}', atime, 'unixepoch')".format(timefmt) hist_cat = sqlcategory.SqlCategory( - 'History', sort_order='desc', sort_by='atime', group_by='url', + 'History', sort_order='desc', sort_by='atime', filter_fields=['url', 'title'], select='url, title, {}'.format(select_time), where='not redirect') model.add_category(hist_cat) diff --git a/tests/unit/completion/test_models.py b/tests/unit/completion/test_models.py index c46287926..46730cc21 100644 --- a/tests/unit/completion/test_models.py +++ b/tests/unit/completion/test_models.py @@ -306,7 +306,9 @@ def test_url_completion(qtmodeltester, config_stub, web_history, quickmarks, "History": [ ('https://github.com', 'https://github.com', '2016-05-01'), ('https://python.org', 'Welcome to Python.org', '2016-03-08'), + ('https://python.org', 'Welcome to Python.org', '2016-02-08'), ('http://qutebrowser.org', 'qutebrowser', '2015-09-05'), + ('https://python.org', 'Welcome to Python.org', '2014-03-08'), ], })