forked from 0x2620/pandora
load subtitles in sync with creating timeline, use stream duration for files
This commit is contained in:
parent
6ab2ae3c54
commit
f5cd0cf2ca
4 changed files with 17 additions and 9 deletions
|
|
@ -203,9 +203,11 @@ class File(models.Model):
|
|||
|
||||
if self.type not in ('audio', 'video'):
|
||||
self.duration = None
|
||||
elif self.duration <= 0:
|
||||
self.duration = sum([s.info.get('duration',0)
|
||||
else:
|
||||
duration = sum([s.info.get('duration', 0)
|
||||
for s in self.streams.filter(source=None)])
|
||||
if duration:
|
||||
self.duration = duration
|
||||
|
||||
if self.is_subtitle:
|
||||
self.available = self.data and True or False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue