sort manual

This commit is contained in:
j 2017-08-12 10:59:08 +02:00
parent 944c68ab3c
commit 4f88792491

View file

@ -21,6 +21,9 @@ def get_info(api, oshash):
}, },
'keys': ['id', 'instances', 'resolution'] 'keys': ['id', 'instances', 'resolution']
})['data'] })['data']
if not r['items'][0]['instances']:
print(r)
raise Exception('item without instance')
files[oshash] = { files[oshash] = {
'path': os.path.join(prefix, r['items'][0]['instances'][0]['path']), 'path': os.path.join(prefix, r['items'][0]['instances'][0]['path']),
'resolution': r['items'][0]['resolution'] 'resolution': r['items'][0]['resolution']
@ -35,7 +38,11 @@ def sort_clips(edit, sort):
reverse = sort.startswith('-') reverse = sort.startswith('-')
last = '' if reverse else 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' last = '' if reverse else 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
sort = sort.lstrip('-') sort = sort.lstrip('-')
if sort in [ if sort == 'manual':
s = clips
if reverse:
s = reversed(s)
elif sort in [
'id', 'index', 'in', 'out', 'duration', 'id', 'index', 'in', 'out', 'duration',
'title', 'director', 'year', 'videoRatio' 'title', 'director', 'year', 'videoRatio'
]: ]: