forked from 0x2620/pandora
use stream height by default
This commit is contained in:
parent
31713e5f3b
commit
81748afa2d
2 changed files with 6 additions and 3 deletions
|
|
@ -850,7 +850,7 @@ class Item(models.Model):
|
|||
'''
|
||||
Video related functions
|
||||
'''
|
||||
def frame(self, position, height=128):
|
||||
def frame(self, position, height=None):
|
||||
offset = 0
|
||||
streams = self.streams()
|
||||
for stream in streams:
|
||||
|
|
@ -858,7 +858,10 @@ class Item(models.Model):
|
|||
offset += stream.duration
|
||||
else:
|
||||
position = position - offset
|
||||
height = min(height, stream.resolution)
|
||||
if not height:
|
||||
height = stream.resolution
|
||||
else:
|
||||
height = min(height, stream.resolution)
|
||||
path = os.path.join(settings.MEDIA_ROOT, stream.path(),
|
||||
'frames', "%dp"%height, "%s.jpg"%position)
|
||||
if not os.path.exists(path) and stream.video:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue