curds: Use sort keys for inserting playlist nodes

This is slower, but puts things in their right place. Implementing a
bisect search should help speed this up.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
Anna Schumaker 2019-06-02 20:36:41 -04:00
parent 48edd46446
commit 53ae9ccb6c

View File

@ -77,7 +77,7 @@ class PlaylistNode:
def insert_child(self, child):
for i, n in enumerate(self.children):
if child < n:
if child.sort_key() < n.sort_key():
return self.__insert_node__(child, i)
return self.append_child(child)