diff --git a/data/interfaces/default/css/plexpy.css b/data/interfaces/default/css/plexpy.css index 5872a561..52b03b68 100644 --- a/data/interfaces/default/css/plexpy.css +++ b/data/interfaces/default/css/plexpy.css @@ -1162,6 +1162,10 @@ a .dashboard-activity-metadata-user-thumb:hover { } .dashboard-stats-info-title h4 { margin: 0; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + flex-basis: 250px; -webkit-flex-grow: 1; flex-grow: 1; } @@ -1170,6 +1174,10 @@ a .dashboard-activity-metadata-user-thumb:hover { font-size: 12px; text-align: right; text-transform: uppercase; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + max-width: 125px; } .dashboard-stats-info-scroller { height: 120px; @@ -1187,7 +1195,7 @@ a .dashboard-activity-metadata-user-thumb:hover { .dashboard-stats-info { width: 100%; font-size: 12px; - padding: 5px 0 5px 15px; + padding: 3px 0 5px 15px; position: relative; } .dashboard-stats-info-list { @@ -1206,6 +1214,7 @@ a .dashboard-activity-metadata-user-thumb:hover { padding: 2.5px 5px; line-height: 14px; border-bottom: 1px solid rgba(255,255,255,0.05); + cursor: default; } .dashboard-stats-info-item:last-of-type { margin-bottom: 0; diff --git a/data/interfaces/default/home_stats.html b/data/interfaces/default/home_stats.html index 0deeff24..d0e821ef 100644 --- a/data/interfaces/default/home_stats.html +++ b/data/interfaces/default/home_stats.html @@ -65,31 +65,39 @@ DOCUMENTATION :: END % if data and any(top_stat['rows'] for top_stat in data): % for top_stat in data: % if top_stat['rows']: -<% stat_id = top_stat['stat_id'] %> -
+<% + stat_id = top_stat['stat_id'] + row0 = top_stat['rows'][0] +%> +
% if stat_id in ('top_movies', 'popular_movies', 'top_tv', 'popular_tv', 'top_music', 'popular_music', 'last_watched'): -
+ % if row0['art']: +
+ % else: +
+ % endif % else:
% endif % if stat_id in ('top_movies', 'popular_movies', 'top_tv', 'popular_tv', 'top_music', 'popular_music', 'last_watched'): - % elif stat_id == 'top_users': - % elif stat_id == 'top_platforms': % elif stat_id == 'most_concurrent': @@ -104,15 +112,18 @@ DOCUMENTATION :: END hh:mm % elif stat_id.startswith('popular'): users + % elif stat_id == 'last_watched': + ${row0['friendly_name']} % elif stat_id == 'most_concurrent': - streams + streams % endif
    % for row in top_stat['rows']: -
  • +
  • ${loop.index + 1}
    % if stat_id in ('top_movies', 'popular_movies', 'top_tv', 'popular_tv', 'top_music', 'popular_music', 'last_watched'): @@ -138,9 +149,9 @@ DOCUMENTATION :: END % endif
    - % if top_stat.get('stat_type') == 'total_plays': + % if stat_id.startswith('top') and top_stat.get('stat_type') == 'total_plays': ${row['total_plays']} - % elif top_stat.get('stat_type') == 'total_duration': + % elif stat_id.startswith('top') and top_stat.get('stat_type') == 'total_duration': ${row['total_duration'] | hd} % elif stat_id.startswith('popular'): ${row['users_watched']} @@ -166,7 +177,7 @@ DOCUMENTATION :: END var stat_id = $(elem).data('stat_id'); var art = $(elem).data('art'); var thumb = $(elem).data('thumb'); - var [height, fallback] = ($.inArray(stat_id, ['top_music', 'popular_music'])) ? [450, 'poster'] : [300, 'cover']; + var [height, fallback] = ($.inArray(stat_id, ['top_music', 'popular_music']) > -1) ? [300, 'cover'] : [450, 'poster']; if (stat_id == 'most_concurrent') { return @@ -190,9 +201,22 @@ DOCUMENTATION :: END $('.dashboard-stats-info-item').mouseenter(function () { changeImages(this) + if ($(this).data('stat_id') == 'last_watched') { + var friendly_name = $(this).data('friendly_name'); + var last_watch = moment($(this).data('last_watch'), 'X').format(date_format); + $('#last-watched-header-info').html(friendly_name); + } else if ($(this).data('stat_id') == 'most_concurrent') { + var started = moment($(this).data('started'), 'X').format(date_format + ' ' + time_format); + $('#most-concurrent-header-info').html(started); + } }); $('.dashboard-stats-instance').mouseleave(function () { changeImages($(this).find('.dashboard-stats-info-item').first()) + if ($(this).data('stat_id') == 'last_watched') { + $('#last-watched-header-info').text($(this).find('.dashboard-stats-info-item').first().data('friendly_name')); + } else if ($(this).data('stat_id') == 'most_concurrent') { + $('#most-concurrent-header-info').text('streams'); + } }); % else: diff --git a/data/interfaces/default/index.html b/data/interfaces/default/index.html index fb470173..71eb80d4 100644 --- a/data/interfaces/default/index.html +++ b/data/interfaces/default/index.html @@ -489,8 +489,8 @@ data: session, complete: function(xhr, status) { $('#currentActivity').append(xhr.responseText); - $('#instance-' + session.session_key + ' .dashboard-activity-info-scroller').scrollbar(); - $('#instance-' + session.session_key + ' [data-toggle=tooltip]').tooltip({ container: 'body', placement: 'right', delay: 50 }) + $('#activity-instance-' + session.session_key + ' .dashboard-activity-info-scroller').scrollbar(); + $('#activity-instance-' + session.session_key + ' [data-toggle=tooltip]').tooltip({ container: 'body', placement: 'right', delay: 50 }) $('#terminate-button-' + session.session_key).tooltip('destroy').tooltip({ container: 'body', placement: 'left', delay: 50 }); } }); diff --git a/plexpy/datafactory.py b/plexpy/datafactory.py index 86f9618f..b5f502dd 100644 --- a/plexpy/datafactory.py +++ b/plexpy/datafactory.py @@ -738,7 +738,7 @@ class DataFactory(object): last_watched.append(row) home_stats.append({'stat_id': stat, - 'stat_title': 'Last Watched Items', + 'stat_title': 'Recently Watched', 'rows': session.mask_session_info(last_watched)}) elif stat == 'most_concurrent':