From 84a8a82fcb10460ea5fc65de8de2e84c1519501d Mon Sep 17 00:00:00 2001 From: rolux Date: Wed, 22 Aug 2012 12:36:17 +0200 Subject: [PATCH] movie.py: more bugfixes --- ox/movie.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ox/movie.py b/ox/movie.py index 837624f..6847d76 100644 --- a/ox/movie.py +++ b/ox/movie.py @@ -113,7 +113,7 @@ def parse_item_files(files): else: version_files[key] = (version_files[key] if key in version_files else []) + [file] extension[key] = None - # determine main_files (video + subtitles) + # determine main_files (video + srt) full = {} language = {} main_files = {} @@ -135,11 +135,12 @@ def parse_item_files(files): language[version_key] = subtitle_language main_files[version_key] += language_files break - # determine main version (best subtitle language, then video time) + # determine main version (best srt language, then video time) main_version = None full_version_keys = sorted( [version_key for version_key in version_files if full[version_key]], - key=lambda x: -time[x] + key=lambda x: time[x], + reverse=True ) if full_version_keys: language_version_keys = sorted(