diff --git a/recommendation_engine.py b/recommendation_engine.py index 00cd055..e32d800 100644 --- a/recommendation_engine.py +++ b/recommendation_engine.py @@ -470,10 +470,15 @@ class Engine: f.write(json.dumps(videos, indent=4, sort_keys=True)) # Get video order order = {video['id']: int(video['order']) for video in videos} + code = {video['id']: video['code'] for video in videos} # Sort clips clips = sorted( clips, - key=lambda clip: (order[clip['id'].split('/')[0]], clip['in']) + key=lambda clip: ( + order[clip['id'].split('/')[0]], + ox.sort_string(code[clip['id'].split('/')[0]], + clip['in'] + ) ) # Get and cache playlists self.playlists = [playlist for playlist in [{