movie.py: minor fixes

This commit is contained in:
rolux 2012-08-20 20:08:50 +02:00
parent 8ffb8fb4b1
commit 73fa8fbecc

View file

@ -232,7 +232,6 @@ def parse_paths(paths):
file for file in version_files[version] if file['extension'] == extension file for file in version_files[version] if file['extension'] == extension
]) >= len(parts): ]) >= len(parts):
data[version]['videoExtensions'].append(extension) data[version]['videoExtensions'].append(extension)
break
# subtitleLanguages # subtitleLanguages
languages = sorted(list(set([ languages = sorted(list(set([
file['language'] for file in version_files[version] if file['extension'] == 'srt' file['language'] for file in version_files[version] if file['extension'] == 'srt'
@ -268,7 +267,10 @@ def parse_paths(paths):
if filtered: if filtered:
data[filtered[0]]['isMainVersion'] = True data[filtered[0]]['isMainVersion'] = True
else: else:
filtered = [version for version in versions if data[version]['videoExtensions']] filtered = sorted(
[version for version in versions if data[version]['videoExtensions']],
key=lambda x: data[x]['videoExtensions'][0]
)
if filtered: if filtered:
data[filtered[0]]['isMainVersion'] = True data[filtered[0]]['isMainVersion'] = True
return data return data