Fix centering last item on newsletter

This commit is contained in:
JonnyWong16 2018-04-04 20:45:34 -07:00
parent 45c646c062
commit 366e8514b6
6 changed files with 554 additions and 450 deletions

View file

@ -698,9 +698,12 @@ class RecentlyAdded(Newsletter):
item['thumb_hash'] = set_hash_image_info(
img=item['thumb'], width=150, height=225, fallback='poster')
item['art_hash'] = set_hash_image_info(
img=item['art'], width=500, height=280,
opacity=25, background='282828', blur=3, fallback='art')
if item['art']:
item['art_hash'] = set_hash_image_info(
img=item['art'], width=500, height=280,
opacity=25, background='282828', blur=3, fallback='art')
else:
item['art_hash'] = ''
item['poster_url'] = ''
item['art_url'] = ''

View file

@ -1119,6 +1119,9 @@ def get_imgur_info(img=None, rating_key=None, title='', width=600, height=1000,
def set_hash_image_info(img=None, rating_key=None, width=600, height=1000,
opacity=100, background='000000', blur=0, fallback=None):
if not rating_key and not img:
return fallback
if rating_key and not img:
if fallback == 'art':
img = '/library/metadata/{}/art'.format(rating_key)

View file

@ -4021,6 +4021,18 @@ class WebInterface(object):
def image(self, *args, **kwargs):
if args:
img_hash = args[0]
if img_hash in ('poster', 'cover', 'art'):
if img_hash == 'poster':
fbi = common.DEFAULT_POSTER_THUMB
elif img_hash == 'cover':
fbi = common.DEFAULT_COVER_THUMB
elif img_hash == 'art':
fbi = common.DEFAULT_ART
fp = os.path.join(plexpy.PROG_DIR, 'data', fbi)
return serve_file(path=fp, content_type='image/png')
img_info = notification_handler.get_hash_image_info(img_hash=img_hash)
if img_info: