fix offset option in srt
This commit is contained in:
parent
18f8b1a1f4
commit
64376795ff
2 changed files with 8 additions and 1 deletions
|
@ -214,6 +214,13 @@ class File(models.Model):
|
||||||
for i in range(1, len(srt)):
|
for i in range(1, len(srt)):
|
||||||
if srt[i-1]['out'] > srt[i]['in']:
|
if srt[i-1]['out'] > srt[i]['in']:
|
||||||
srt[i-1]['out'] = srt[i]['in']
|
srt[i-1]['out'] = srt[i]['in']
|
||||||
|
|
||||||
|
def shift(s):
|
||||||
|
s['in'] += offset
|
||||||
|
s['out'] += offset
|
||||||
|
return s
|
||||||
|
if offset:
|
||||||
|
srt = map(shift, srt)
|
||||||
return srt
|
return srt
|
||||||
|
|
||||||
def editable(self, user):
|
def editable(self, user):
|
||||||
|
|
|
@ -19,7 +19,7 @@ def get_or_create_item(volume, info, user):
|
||||||
item_info = ox.parse_movie_path(info['path'])
|
item_info = ox.parse_movie_path(info['path'])
|
||||||
if item_info.get('director') and item_info.get('directorSort'):
|
if item_info.get('director') and item_info.get('directorSort'):
|
||||||
for name, sortname in zip(item_info['director'], item_info['directorSort']):
|
for name, sortname in zip(item_info['director'], item_info['directorSort']):
|
||||||
get_name_sort(name, sortname)
|
get_name_sort(name, sortname)
|
||||||
return get_item(item_info, user)
|
return get_item(item_info, user)
|
||||||
|
|
||||||
def get_or_create_file(volume, f, user, item=None):
|
def get_or_create_file(volume, f, user, item=None):
|
||||||
|
|
Loading…
Reference in a new issue