diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 87a3d81d1..9dd4e29f8 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -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): diff --git a/tests/functional/openlp_plugins/songs/test_mediaitem.py b/tests/functional/openlp_plugins/songs/test_mediaitem.py index 2b586a96a..d09f5b76e 100644 --- a/tests/functional/openlp_plugins/songs/test_mediaitem.py +++ b/tests/functional/openlp_plugins/songs/test_mediaitem.py @@ -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): """