forked from 0x2620/pandora
select frame
This commit is contained in:
parent
33cec4a30d
commit
e1bdc83980
1 changed files with 8 additions and 0 deletions
|
@ -25,6 +25,7 @@ import ox
|
||||||
from ox.django import fields
|
from ox.django import fields
|
||||||
from ox.normalize import canonicalTitle
|
from ox.normalize import canonicalTitle
|
||||||
import ox.web.imdb
|
import ox.web.imdb
|
||||||
|
import ox.image
|
||||||
|
|
||||||
import managers
|
import managers
|
||||||
import utils
|
import utils
|
||||||
|
@ -952,6 +953,13 @@ class Item(models.Model):
|
||||||
offset += f.duration
|
offset += f.duration
|
||||||
return frames
|
return frames
|
||||||
|
|
||||||
|
def select_frame(self):
|
||||||
|
frames = self.poster_frames()
|
||||||
|
if frames:
|
||||||
|
heat = [ox.image.getImageHeat(f['path']) for f in frames]
|
||||||
|
self.poster_frame = heat.index(max(heat))
|
||||||
|
self.save()
|
||||||
|
|
||||||
def get_poster_frame_path(self):
|
def get_poster_frame_path(self):
|
||||||
frames = self.poster_frames()
|
frames = self.poster_frames()
|
||||||
if self.poster_frame >= 0:
|
if self.poster_frame >= 0:
|
||||||
|
|
Loading…
Reference in a new issue