movie.py: use original file path

This commit is contained in:
rolux 2012-08-20 20:28:11 +02:00
parent 3f6547f28f
commit 563f9a2a6d

View file

@ -201,7 +201,7 @@ def parse_path(path):
def parse_paths(paths): def parse_paths(paths):
files = [parse_path(path) for path in paths] files = [dict(parse_path(path), originalPath=path) for path in sorted(paths)]
data = {} data = {}
version_files = {} version_files = {}
versions = sorted(list(set([file['version'] for file in files]))) versions = sorted(list(set([file['version'] for file in files])))
@ -249,12 +249,12 @@ def parse_paths(paths):
] if data[version]['subtitleLanguages'] else [] ] if data[version]['subtitleLanguages'] else []
for file in files_by_part: for file in files_by_part:
file['isMainFile'] = ( file['isMainFile'] = (
len(videos) > 0 and file['path'] == videos[0]['path'] len(videos) > 0 and file['originalPath'] == videos[0]['originalPath']
) or ( ) or (
len(subtitles) > 0 and file['path'] == subtitles[0]['path'] len(subtitles) > 0 and file['originalPath'] == subtitles[0]['originalPath']
) )
data[version]['files'].append([ data[version]['files'].append([
{'isMainFile': file['isMainFile'], 'path': file['path']} for file in files_by_part {'isMainFile': file['isMainFile'], 'path': file['originalPath']} for file in files_by_part
]) ])
# isMainVersion # isMainVersion
filtered = sorted( filtered = sorted(