From 075f9f8cbdb8922240695561340cfa5a8250659d Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Mon, 17 Feb 2020 12:06:24 -0800 Subject: [PATCH] Fallback to Live TV art/poster for watch statistics --- data/interfaces/default/home_stats.html | 53 +++++++++++++++---------- plexpy/datafactory.py | 21 ++++++---- 2 files changed, 47 insertions(+), 27 deletions(-) diff --git a/data/interfaces/default/home_stats.html b/data/interfaces/default/home_stats.html index b6c49673..f274ab0a 100644 --- a/data/interfaces/default/home_stats.html +++ b/data/interfaces/default/home_stats.html @@ -73,7 +73,8 @@ DOCUMENTATION :: END
% if stat_id in ('top_movies', 'popular_movies', 'top_tv', 'popular_tv', 'top_music', 'popular_music', 'last_watched'): % if row0['art']: -
+ <% fallback = 'art-live' if row0['live'] else 'art' %> +
% else:
% endif @@ -87,7 +88,13 @@ DOCUMENTATION :: END % if stat_id in ('top_music', 'popular_music'):
% endif - <% height, type = ('300', 'cover') if stat_id in ('top_music', 'popular_music') else ('450', 'poster') %> + <% + height, type = ('450', 'poster') + if stat_id in ('top_music', 'popular_music'): + height, type = ('300', 'cover') + elif row0['live']: + height, type = ('450', 'poster-live') + %> <% href = 'info?rating_key={}'.format(row0['rating_key']) if row0['rating_key'] else '#' %> % if row0['thumb']: @@ -129,7 +136,7 @@ DOCUMENTATION :: END
  • + data-last_watch="${row.get('last_watch')}" data-started="${row.get('started')}" data-live="${row.get('live')}">
    ${loop.index + 1}
    % if stat_id in ('top_movies', 'popular_movies', 'top_tv', 'popular_tv', 'top_music', 'popular_music', 'last_watched'): @@ -171,7 +178,7 @@ DOCUMENTATION :: END % endif % endfor