sort manual
This commit is contained in:
parent
944c68ab3c
commit
4f88792491
1 changed files with 8 additions and 1 deletions
9
edit.py
9
edit.py
|
@ -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'
|
||||||
]:
|
]:
|
||||||
|
|
Loading…
Reference in a new issue