This commit is contained in:
rolux 2011-10-28 19:43:28 +00:00
commit 9b6b5e8176
3 changed files with 4 additions and 8 deletions

View file

@ -218,8 +218,8 @@ class Item(models.Model):
response = external_data('getData', {'id': self.itemId}) response = external_data('getData', {'id': self.itemId})
if response['status']['code'] == 200: if response['status']['code'] == 200:
self.external_data = response['data'] self.external_data = response['data']
self.save()
self.make_poster(True) self.make_poster(True)
self.save()
def expand_connections(self): def expand_connections(self):
c = self.get('connections') c = self.get('connections')
@ -817,7 +817,6 @@ class Item(models.Model):
update = True update = True
if update: if update:
self.rendered = False self.rendered = False
self.save()
self.update_timeline() self.update_timeline()
break break
@ -943,7 +942,6 @@ class Item(models.Model):
if url: if url:
data = ox.net.readUrl(url) data = ox.net.readUrl(url)
self.poster.save('poster.jpg', ContentFile(data)) self.poster.save('poster.jpg', ContentFile(data))
self.save()
elif os.path.exists(poster): elif os.path.exists(poster):
with open(poster) as f: with open(poster) as f:
data = f.read() data = f.read()
@ -1006,7 +1004,6 @@ class Item(models.Model):
if frames: if frames:
heat = [ox.image.getImageHeat(f['path']) for f in frames] heat = [ox.image.getImageHeat(f['path']) for f in frames]
self.poster_frame = heat.index(max(heat)) 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()
@ -1034,7 +1031,6 @@ class Item(models.Model):
cmd += ['-f', frame] cmd += ['-f', frame]
p = subprocess.Popen(cmd) p = subprocess.Popen(cmd)
p.wait() p.wait()
self.save()
icons = os.path.abspath(os.path.join(settings.MEDIA_ROOT, icon)) icons = os.path.abspath(os.path.join(settings.MEDIA_ROOT, icon))
icons = glob(icons.replace('.jpg', '*.jpg')) icons = glob(icons.replace('.jpg', '*.jpg'))
for f in filter(lambda p: not p.endswith('/icon.jpg'), icons): for f in filter(lambda p: not p.endswith('/icon.jpg'), icons):

View file

@ -17,7 +17,7 @@ def update_poster(itemId):
item = models.Item.objects.get(itemId=itemId) item = models.Item.objects.get(itemId=itemId)
item.make_poster(True) item.make_poster(True)
item.make_icon() item.make_icon()
item.save()
@task(ignore_resulsts=True, queue='default') @task(ignore_resulsts=True, queue='default')
def update_external(itemId): def update_external(itemId):

View file

@ -340,10 +340,10 @@ pandora.ui.infoView = function(data) {
) )
.appendTo($text); .appendTo($text);
data.releaseDate && $('<div>') data.releasedate && $('<div>')
.css(css) .css(css)
.html( .html(
formatKey('Release Date') + Ox.formatDate(data.releaseDate, '%A, %B %e, %Y') formatKey('Release Date') + Ox.formatDate(data.releasedate, '%A, %B %e, %Y')
) )
.appendTo($text); .appendTo($text);