forked from 0x2620/pandora
use max resolutions not first
This commit is contained in:
parent
ffc7b693a7
commit
b9a01b2db9
3 changed files with 3 additions and 3 deletions
|
@ -43,7 +43,7 @@ class Command(BaseCommand):
|
||||||
stream.file.info = stream.info
|
stream.file.info = stream.info
|
||||||
stream.file.save()
|
stream.file.save()
|
||||||
#link streams
|
#link streams
|
||||||
resolution = settings.CONFIG['video']['resolutions'][0]
|
resolution = max(settings.CONFIG['video']['resolutions'])
|
||||||
format = settings.CONFIG['video']['formats'][0]
|
format = settings.CONFIG['video']['formats'][0]
|
||||||
for s in models.Stream.objects.exclude(format=format, resolution=resolution).filter(source=None):
|
for s in models.Stream.objects.exclude(format=format, resolution=resolution).filter(source=None):
|
||||||
s.source = models.Stream.objects.get(file=s.file, resolution=resolution, format=format)
|
s.source = models.Stream.objects.get(file=s.file, resolution=resolution, format=format)
|
||||||
|
|
|
@ -250,7 +250,7 @@ class File(models.Model):
|
||||||
config = settings.CONFIG['video']
|
config = settings.CONFIG['video']
|
||||||
stream, created = Stream.objects.get_or_create(
|
stream, created = Stream.objects.get_or_create(
|
||||||
file=self,
|
file=self,
|
||||||
resolution=config['resolutions'][0],
|
resolution=max(config['resolutions']),
|
||||||
format=config['formats'][0])
|
format=config['formats'][0])
|
||||||
if created:
|
if created:
|
||||||
stream.video.name = stream.path(stream.name())
|
stream.video.name = stream.path(stream.name())
|
||||||
|
|
|
@ -1232,7 +1232,7 @@ class Item(models.Model):
|
||||||
elif frames:
|
elif frames:
|
||||||
path = frames[int(len(frames)/2)]['path']
|
path = frames[int(len(frames)/2)]['path']
|
||||||
else:
|
else:
|
||||||
size = settings.CONFIG['video']['resolutions'][0]
|
size = max(settings.CONFIG['video']['resolutions'])
|
||||||
path = self.frame(self.poster_frame, size)
|
path = self.frame(self.poster_frame, size)
|
||||||
|
|
||||||
return path
|
return path
|
||||||
|
|
Loading…
Reference in a new issue