diff --git a/pandora/clip/models.py b/pandora/clip/models.py index e66408a7d..d9c141433 100644 --- a/pandora/clip/models.py +++ b/pandora/clip/models.py @@ -190,11 +190,6 @@ class MetaClip(object): def __str__(self): return self.public_id - def get_first_frame(self, resolution=None): - if resolution is None: - resolution = max(settings.CONFIG['video']['resolutions']) - return '/%s/%sp%0.03f.jpg' % (self.item.public_id, resolution, float(self.start)) - class Meta: unique_together = ("item", "start", "end") diff --git a/pandora/mobile/views.py b/pandora/mobile/views.py index 31920d6de..2390c3909 100644 --- a/pandora/mobile/views.py +++ b/pandora/mobile/views.py @@ -47,7 +47,11 @@ def index(request, fragment): context['title'] = name context['description'] = edit.description.split('\n\n')[0] # FIXME: use sort from parts if needed - context['preview'] = request.build_absolute_uri(edit.get_clips().first().get_first_frame()) + resolution = max(settings.CONFIG['video']['resolutions']) + clip = edit.get_clips().first() + if clip: + preview = '/%s/%sp%0.03f.jpg' % (clip.item.public_id, resolution, float(clip.start)) + context['preview'] = request.build_absolute_uri(preview) else: type = 'item' id = parts[0]