natural sort lower case

This commit is contained in:
Chris Hill 2016-02-13 16:57:09 +00:00
parent 3eecea213d
commit 41d627e3f9
2 changed files with 2 additions and 2 deletions

View File

@ -699,7 +699,7 @@ class SongMediaItem(MediaManagerItem):
Return a tuple by which s is sorted.
:param s: A string value from the list we want to sort.
"""
return [int(text) if text.isdecimal() else text
return [int(text) if text.isdecimal() else text.lower()
for text in re.split('(\d+)', s)]
def search(self, string, show_error):

View File

@ -427,7 +427,7 @@ class TestMediaItem(TestCase, TestMixin):
sort_key_result = self.media_item._natural_sort_key(string_sort_key)
# THEN: We should get back a tuple split on integers
self.assertEqual(sort_key_result, ['A', 1, 'B', 12, 'C'])
self.assertEqual(sort_key_result, ['a', 1, 'b', 12, 'c'])
def build_remote_search_test(self):
"""