diff --git a/pandora/item/models.py b/pandora/item/models.py index 28bae71..faff282 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -239,6 +239,7 @@ def getItem(info): #item.save() #tasks.updateImdb.delay(item.itemId) item.updateImdb() + tasks.updatePoster.delay(item.itemId) else: q = Item.objects.filter(find__title=info['title']) if q.count() > 1: @@ -776,10 +777,14 @@ class Item(models.Model): posters = self.local_posters() for poster in posters: frame = posters[poster] + timeline = os.path.join(itemid_path(self.itemId), 'timeline.64.png') + timeline = os.path.abspath(os.path.join(settings.MEDIA_ROOT, timeline)) cmd = [settings.ITEM_POSTER, '-t', self.get('title'), '-d', ', '.join(self.get('directors', ['Unknown Director'])), + '-y', str(self.get('year', '')), '-f', frame, + '-l', timeline, '-p', poster ] if len(self.itemId) == 7: diff --git a/pandora/scripts/item_icon b/pandora/scripts/item_icon index c9fca1d..31e4bb9 100755 --- a/pandora/scripts/item_icon +++ b/pandora/scripts/item_icon @@ -10,7 +10,7 @@ from ox.image import drawText, wrapText import sys -static_root = os.path.join(os.path.dirname(__file__), '..', 'static') +static_root = os.path.join(os.path.dirname(__file__), '..', '..', 'static') def render_icon(frame, timeline, icon): icon_width = 256 diff --git a/pandora/scripts/list_icon b/pandora/scripts/list_icon index 048fb06..dcfa0d4 100755 --- a/pandora/scripts/list_icon +++ b/pandora/scripts/list_icon @@ -10,7 +10,7 @@ from ox.image import drawText, wrapText import sys -static_root = os.path.join(os.path.dirname(__file__), '..', 'static') +static_root = os.path.join(os.path.dirname(__file__), '..', '..', 'static') def render_list_icon(frames, icon): icon_width = 256 diff --git a/pandora/scripts/oxdb_poster b/pandora/scripts/oxdb_poster index ced0798..f8c1f14 100755 --- a/pandora/scripts/oxdb_poster +++ b/pandora/scripts/oxdb_poster @@ -10,7 +10,7 @@ from ox.image import drawText, wrapText import sys -static_root = os.path.join(os.path.dirname(__file__), '..', 'static') +static_root = os.path.join(os.path.dirname(__file__), '..', '..', 'static') def render_poster(title, director, year, series, oxdb_id, imdb_id, frame, timeline, poster): def get_oxdb_color(oxdb_id, series=False): @@ -37,6 +37,7 @@ def render_poster(title, director, year, series, oxdb_id, imdb_id, frame, timeli poster_image = Image.new('RGB', (poster_width, poster_height)) draw = ImageDraw.Draw(poster_image) font_file = os.path.join(static_root, 'ttf', 'DejaVuSansCondensedBold.ttf') + font_size = { 'small': 28, 'large': 42, @@ -109,9 +110,9 @@ def render_poster(title, director, year, series, oxdb_id, imdb_id, frame, timeli logo_color = logo_image.getpixel((x, y))[0] alpha = logo_image.getpixel((x, y))[3] if series: - poster_color = tuple(map(lambda x: x - (logo_color - 16) * alpha / 255, poster_color)) + poster_color = tuple(map(lambda x: int(x - (logo_color - 16) * alpha / 255), poster_color)) else: - poster_color = tuple(map(lambda x: x + (logo_color - 16) * alpha / 255, poster_color)) + poster_color = tuple(map(lambda x: int(x + (logo_color - 16) * alpha / 255), poster_color)) poster_image.putpixel((logo_left + x, logo_top + y), poster_color) poster_image.save(poster) diff --git a/pandora/scripts/padma_poster b/pandora/scripts/padma_poster index 90f58ec..06c3a95 100755 --- a/pandora/scripts/padma_poster +++ b/pandora/scripts/padma_poster @@ -9,7 +9,7 @@ import os from ox.image import drawText, wrapText import sys -static_root = os.path.join(os.path.dirname(__file__), '..', 'static') +static_root = os.path.join(os.path.dirname(__file__), '..', '..', 'static') def render_poster(id, title, frame, timeline, poster): poster_width = 640