Just had the following exception thrown
File "/app/server/server.py", line 61, in search
"results" : dosearch.search(srchterm, search_type, limit, count_only)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/server/../lib/dosearch.py", line 281, in search
results.sort(reverse=True, key=lambda x: x.get("last-mod-s", 0))
File "/app/server/../lib/dosearch.py", line 281, in <lambda>
results.sort(reverse=True, key=lambda x: x.get("last-mod-s", 0))
^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'int' object has no attribute 'get'
Activity
02-Jun-24 21:41
assigned to @btasker
02-Jun-24 21:46
That part of the code is supposed to be sorting results in reverse chronographical order.
However, my search won't have returned results - it's a count-only search:
During a count-only search, the search threads will return a list containing a single entry: the count.
02-Jun-24 21:46
mentioned in commit 015c0f6fc2f470de7d8cbb25187659c045be86ce
Message
fix: don't try to sort results in count-only mode (utilities/file_location_listing#56)
02-Jun-24 21:47
changed title from AttributeError: 'int' object has no attribute 'get' to {+Count only mode throws +}AttributeError: 'int' object has no attribute 'get'