From d8ad9adabd8fd1fbb510443316b26c0fb5587753 Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Sat, 23 Apr 2016 00:11:30 -0700 Subject: [PATCH] A bunch of UI updates --- data/interfaces/default/base.html | 71 ++++++-- data/interfaces/default/css/plexpy.css | 167 ++++++++++++------ .../default/current_activity_header.html | 4 +- data/interfaces/default/index.html | 27 ++- data/interfaces/default/info.html | 2 +- .../default/library_recently_added.html | 62 ++++--- data/interfaces/default/login.html | 4 +- data/interfaces/default/recently_added.html | 61 +++++-- data/interfaces/default/settings.html | 115 +++++++++--- .../default/user_recently_watched.html | 44 +++-- plexpy/config.py | 15 +- plexpy/libraries.py | 5 +- plexpy/users.py | 5 +- plexpy/webserve.py | 19 +- 14 files changed, 425 insertions(+), 176 deletions(-) diff --git a/data/interfaces/default/base.html b/data/interfaces/default/base.html index 7dc07bf0..9045eae7 100644 --- a/data/interfaces/default/base.html +++ b/data/interfaces/default/base.html @@ -14,7 +14,7 @@ from plexpy.helpers import anon_url - + ${next.headIncludes()} @@ -176,9 +176,9 @@ from plexpy.helpers import anon_url % if title == "Home": -
  • +
  • % else: -
  • +
  • % endif % if title == "Libraries" or title == "Library" or title == "Info":
  • Libraries
  • @@ -186,9 +186,9 @@ from plexpy.helpers import anon_url
  • Libraries
  • % endif % if title == "Users" or title == "User": -
  • Users
  • +
  • Users
  • % else: -
  • Users
  • +
  • Users
  • % endif % if title == "History":
  • History
  • @@ -196,25 +196,32 @@ from plexpy.helpers import anon_url
  • History
  • % endif % if title == "Graphs": -
  • Graphs
  • +
  • Graphs
  • % else: -
  • Graphs
  • +
  • Graphs
  • % endif % if title == "Synced Items": -
  • Synced Items
  • +
  • Synced Items
  • % else: -
  • Synced Items
  • - % endif - % if title == "Log": -
  • Logs
  • - % else: -
  • Logs
  • +
  • Synced Items
  • % endif % if title == "Settings": -
  • Settings
  • +
  • Settings
  • + @@ -239,6 +246,25 @@ ${next.headerIncludes()} if (!getCookie('updateDismiss')) { $('#updatebar').show(); } + + $("#nav-shutdown").click(function () { + var r = confirm("Are you sure you want to shutdown PlexPy?"); + if (r == true) { + window.location.href = "shutdown"; + } + }); + + $("#nav-restart").click(function () { + window.location.href = "restart"; + }); + + $("#nav-update").first().one("click", function () { + // Allow the update bar to show again if previously dismissed. + setCookie('updateDismiss', 'true', 0); + $(this).html(' Checking'); + window.location.href = "checkGithub"; + }); + ${next.javascriptIncludes()} diff --git a/data/interfaces/default/css/plexpy.css b/data/interfaces/default/css/plexpy.css index 04e00d54..6738fb88 100644 --- a/data/interfaces/default/css/plexpy.css +++ b/data/interfaces/default/css/plexpy.css @@ -1,5 +1,5 @@ body { - font-family: 'Open Sans', sans-serif; + font-family: 'Open Sans', Arial, sans-serif; color: #fff; margin-top: 50px; overflow: hidden; @@ -9,7 +9,7 @@ a { } a:hover, a:focus { - color: #f9aa03; + color: #e9a049; text-decoration: none; outline: none; } @@ -89,7 +89,7 @@ img { .nav > li.active > a, .nav > li.active > a:hover, .nav > li.active > a:focus { - color: #f9aa03; + color: #f9be03; background-color: #282828; } .navbar-toggle { @@ -99,6 +99,36 @@ img { .navbar-toggle:focus { background-color: #2f2f2f; } +@media screen and (min-width: 768px) { + .dropdown:hover > .dropdown-menu { + display: block; + } +} +.dropdown-menu { + background-color: #282828; +} +.dropdown-menu .divider { + background-color: #777; +} +.dropdown-menu > li > a { + color: #999; +} +.dropdown-menu > li > a:hover, +.dropdown-menu > li > a:focus { + color: #fff; + background-color: #2f2f2f; +} +.dropdown-menu > .active > a, +.dropdown-menu > .active > a:hover, +.dropdown-menu > .active > a:focus { + color: #fff; + background-color: #2f2f2f; +} +.dropdown-menu > .disabled > a, +.dropdown-menu > .disabled > a:hover, +.dropdown-menu > .disabled > a:focus { + color: #999; +} .icon-bar { background-color: #999; } @@ -109,7 +139,13 @@ img { color: #eee; } .padded-header h3 { - font-size: 20px; + font-size: 16px; + font-weight: bold; + text-transform: uppercase; +} +.padded-header h3 small { + font-size: 13px; + text-transform: none; } .btn { outline:0px !important; @@ -182,9 +218,9 @@ fieldset[disabled] .btn-dark.active { background-color: #3B3B3B; } .btn-bright { - color: #fff; - background-color: #eb8600; - border-color: transparent; + color: #fff; + background-color: #cc7b19; + box-shadow: inset 0 1px 0 #e7993b; } .btn-bright:focus, .btn-bright.focus { @@ -193,14 +229,15 @@ fieldset[disabled] .btn-dark.active { } .btn-bright:hover { color: #fff; - background-color: #E69400; - border-color: #f9aa03; + background-color: #e59029; + box-shadow: inset 0 1px 0 #ebac60; } .btn-bright:active, .btn-bright.active, .open > .dropdown-toggle.btn-bright { color: #fff; - background-color: #eb8600; + background-color: #cc7b19; + box-shadow: inset 0 1px 0 #e7993b; } .btn-bright:active:hover, .btn-bright.active:hover, @@ -212,7 +249,8 @@ fieldset[disabled] .btn-dark.active { .btn-bright.active.focus, .open > .dropdown-toggle.btn-bright.focus { color: #fff; - background-color: #eb8600; + background-color: #cc7b19; + box-shadow: inset 0 1px 0 #e7993b; } .btn-bright:active, .btn-bright.active, @@ -237,12 +275,13 @@ fieldset[disabled] .btn-bright:active, .btn-bright.disabled.active, .btn-bright[disabled].active, fieldset[disabled] .btn-bright.active { - background-color: #c9302c; - border-color: #ac2925; + background-color: #cc7b19; + border-color: #b56d16; } .btn-bright .badge { color: #fff; - background-color: #eb8600; + background-color: #cc7b19; + box-shadow: inset 0 1px 0 #e7993b; } .btn-danger.btn-edit { color: #d7d7d7; @@ -377,7 +416,7 @@ textarea.form-control:focus { .pagination > li > span:hover, .pagination > li > a:focus, .pagination > li > span:focus { - background-color: #F9AA03; + background-color: #cc7b19; border: 1px solid #444444; } .pagination > .active > a, @@ -389,7 +428,7 @@ textarea.form-control:focus { z-index: 2; color: #fff; cursor: default; - background-color: #F9AA03; + background-color: #cc7b19; border-color: #444444; } .pagination > .disabled > span, @@ -407,7 +446,7 @@ textarea.form-control:focus { .nav-pills > li.active > a:hover, .nav-pills > li.active > a:focus { color: #fff; - background-color: #af6c17; + background-color: #cc7b19; } .nav-pills > li > a { border-radius: 3px; @@ -871,16 +910,16 @@ a .dashboard-activity-metadata-user-thumb:hover { color: #999; } .dashboard-activity-metadata-user a:hover { - color: #F9AA03; + color: #e9a049; } .dashboard-activity-metadata-title a:hover { - color: #F9AA03; + color: #e9a049; } .dashboard-activity-metadata-progress-wrapper { margin-bottom: 20px; font-size: 12px; font-weight: bold; - color: #F9AA03; + color: #e9a049; } .dashboard-recent-media-row { width: 100%; @@ -957,6 +996,7 @@ a:hover .dashboard-recent-media-cover { .dashboard-recent-media-overlay-text { color: #aaa; font-size: 12px; + font-weight: bold; float: left; position: absolute; left: 8px; @@ -974,9 +1014,9 @@ a:hover .dashboard-recent-media-cover { overflow: hidden; position: relative; font-size: 13px; + font-weight: bold; margin: 0; line-height: 15px; - font-weight: normal; width: 150px; white-space: nowrap; text-align: left; @@ -985,13 +1025,11 @@ a:hover .dashboard-recent-media-cover { .dashboard-recent-media-metacontainer h3.text-muted { color: #777; } -.dashboard-recent-media-metacontainer .text-muted { - padding: 5px 3px 0 3px; - text-overflow: ellipsis; - overflow: hidden; - position: relative; - white-space: nowrap; - text-align: left; +.dashboard-recent-media-metacontainer h3.text-muted a { + color: #777; +} +.dashboard-recent-media-metacontainer h3.text-muted a:hover { + color: #e9a049; } .art-face { background-repeat: no-repeat; @@ -1057,7 +1095,7 @@ a:hover .dashboard-recent-media-cover { color: #999; } .summary-navbar-list .breadcrumb a:hover { - color: #F9AA03; + color: #f9be03; } .summary-content-title-wrapper { height: 150px; @@ -1071,7 +1109,7 @@ a:hover .dashboard-recent-media-cover { .summary-content-title h1 { margin-top: 0; margin-bottom: 10px; - color: #F9AA03; + color: #f9be03; font-size: 28px; line-height: 40px; float: left; @@ -1082,11 +1120,10 @@ a:hover .dashboard-recent-media-cover { width: 100%; } .summary-content-title h1 a { - color: #F9AA03; + color: #f9be03; } .summary-content-title h1 a:hover { - color: #F9AA03; - text-decoration: underline; + color: #fff; } .summary-content-title h2 { margin-top: 0; @@ -1335,7 +1372,7 @@ a:hover .summary-poster-face-track .summary-poster-face-overlay span { .star-rating .star-icon { width: auto; margin-left: 2px; - color: #F9AA03; + color: #f9be03; } .star-rating .star-icon-o { width: auto; @@ -1438,6 +1475,7 @@ a:hover .item-children-poster { .item-children-overlay-text { color: #aaa; font-size: 12px; + font-weight: bold; float: left; position: absolute; left: 8px; @@ -1465,9 +1503,9 @@ a:hover .item-children-poster { overflow: hidden; position: relative; font-size: 13px; + font-weight: bold; margin: 0; line-height: 15px; - font-weight: normal; white-space: nowrap; text-align: left; clear: both; @@ -1475,6 +1513,12 @@ a:hover .item-children-poster { .item-children-instance-text-wrapper h3.text-muted { color: #777; } +.item-children-instance-text-wrapper h3.text-muted a { + color: #777; +} +.item-children-instance-text-wrapper h3.text-muted a:hover { + color: #e9a049; +} .item-children-list-item-odd { border-top: 0px solid #343434; border-bottom: 0px solid #343434; @@ -1519,7 +1563,7 @@ a:hover .item-children-poster { margin-right: 20px; } #new_title h3 { - color: #F9AA03; + color: #f9be03; font-size: 14px; line-height: 1.42857143; font-weight: bold; @@ -1582,10 +1626,15 @@ a:hover .item-children-poster { top: 15px; left: -5px; } -.user-info-nav > .active > a, .nav-tabs > .active > a:hover, .nav-tabs > .active > a:focus { - color: #F9AA03; +.user-info-nav > .active > a { + color: #cc7b19; +} +.nav-tabs > .active > a:hover, +.nav-tabs > .active > a:focus { + color: #e9a049; } .user-info-nav a:hover { + color: #e9a049; text-decoration: none; } .user-info-nav ul { @@ -1640,7 +1689,7 @@ a:hover .item-children-poster { .user-overview-stats-instance h3 { font-size: 30px; font-weight: bold; - color: #F9AA03; + color: #f9be03; line-height: 22px; position: relative; top: 5px; @@ -1692,8 +1741,8 @@ a:hover .item-children-poster { text-overflow: ellipsis; overflow: hidden; position: relative; - font-size: 13px; - line-height: 15px; + font-size: 14px; + line-height: 16px; font-weight: normal; width: 140px; margin-left: 10px; @@ -1702,7 +1751,7 @@ a:hover .item-children-poster { .user-player-instance-playcount h3 { font-size: 30px; font-weight: bold; - color: #F9AA03; + color: #f9be03; line-height: 22px; position: relative; top: 5px; @@ -1784,8 +1833,8 @@ a:hover .item-children-poster { text-overflow: ellipsis; overflow: hidden; position: relative; - font-size: 13px; - line-height: 15px; + font-size: 14px; + line-height: 16px; font-weight: bold; width: 100%; padding: 0 0 0 20px; @@ -1810,7 +1859,7 @@ a:hover .item-children-poster { .home-platforms-instance-playcount h3 { font-size: 30px; font-weight: bold; - color: #F9AA03; + color: #f9be03; line-height: 22px; position: relative; top: 5px; @@ -1919,7 +1968,7 @@ a:hover .item-children-poster { height: 60px; } .home-platforms-instance-list-number { - background-color: #eb8600; + background-color: #f9be03; float: left; position: absolute; top: -10px; @@ -1976,7 +2025,7 @@ a:hover .item-children-poster { .home-platforms-instance-list-playcount h3 { font-size: 20px; font-weight: bold; - color: #F9AA03; + color: #f9be03; line-height: 22px; position: relative; margin: 0 5px 0 0; @@ -2071,10 +2120,10 @@ a:hover .item-children-poster { transition: all 0.3s ease; } .home-platforms-instance-list-chevron i:hover { - color: #eb8600; + color: #f9be03; } .home-platforms-instance-list-chevron.active i.fa-chevron-down{ - color: #eb8600; + color: #f9be03; -webkit-transform: rotate(180deg); -ms-transform: rotate(180deg); -o-transform: rotate(180deg); @@ -2173,6 +2222,7 @@ a .home-platforms-instance-list-oval:hover, } .header-bar span { font-size: 22px; + font-weight: bold; line-height: 34px; } .button-bar { @@ -2200,6 +2250,7 @@ a .home-platforms-instance-list-oval:hover, border-top: 1px solid #2d2d2d; } .nav-settings > li > a { + border-bottom: 1px solid #232323; display: block; padding: 15px 15px 15px 15px; color: #999; @@ -2215,7 +2266,7 @@ a .home-platforms-instance-list-oval:hover, .nav-settings > .active > a, .nav-settings > .active > a:hover, .nav-settings > .active > a:focus { - color: #eb8600; + color: #f9be03; background-color: #2f2f2f; } .stacked-configs, @@ -2257,7 +2308,7 @@ a .home-platforms-instance-list-oval:hover, color: #eee; } .stacked-configs > li > span > a.active { - color: #eb8600; + color: #f9be03; } .accordion { width: 100%; @@ -2299,10 +2350,10 @@ a .home-platforms-instance-list-oval:hover, background: #2f2f2f; } .accordion li.open .link { - color: #eb8600; + color: #f9be03; } .accordion li.open i { - color: #eb8600; + color: #f9be03; } .accordion li.open i.fa-chevron-down { -webkit-transform: rotate(180deg); @@ -2330,7 +2381,7 @@ a .home-platforms-instance-list-oval:hover, transition: all 0.25s ease; } .submenu a:hover { - background: #eb8600; + background: #f9be03; color: #FFF; } .ajaxMsg { @@ -2532,7 +2583,7 @@ a .home-platforms-instance-list-oval:hover, margin-right: 3px; } #updatebar a:hover { - color: #F9AA03; + color: #e9a049; } .body-container { position: absolute; @@ -2593,13 +2644,13 @@ table.display tr.shown + tr .pagination > .active > a:hover { table.display tr.shown + tr table[id^='history_child'] td:hover a, table.display tr.shown + tr table[id^='media_info_child'] > tr > td:hover a, table.display tr.shown + tr table[id^='media_info_child'] tr.shown + tr table[id^='media_info_child'] td:hover a { - color: #F9AA03; + color: #cc7b19; } table.display tr.shown + tr .pagination > .disabled > a { color: #444444; } table.display tr.shown + tr .pagination > li > a:hover { - color: #23527c; + color: #e9a049; } table[id^='history_child'] { margin-top: 0; @@ -2791,6 +2842,8 @@ a.no-highlight:hover { #recently-added-row-scroller, #recently-watched-row-scroller { position: relative; + height: 265px; + margin-bottom: 25px; } @media (min-width: 768px) { diff --git a/data/interfaces/default/current_activity_header.html b/data/interfaces/default/current_activity_header.html index 04d8f65b..30fc6c8d 100644 --- a/data/interfaces/default/current_activity_header.html +++ b/data/interfaces/default/current_activity_header.html @@ -18,9 +18,9 @@ DOCUMENTATION :: END % if data == '0':

    Activity

    % elif data == '1': -

    Activity ${data} stream

    +

    Activity   ${data} stream

    % else: -

    Activity ${data} streams

    +

    Activity   ${data} streams

    % endif % else:

    Activity

    diff --git a/data/interfaces/default/index.html b/data/interfaces/default/index.html index 59022365..af584bad 100644 --- a/data/interfaces/default/index.html +++ b/data/interfaces/default/index.html @@ -5,6 +5,8 @@ <%def name="body()">
    + % for section in config['home_sections']: + % if section == 'current_activity':
    @@ -16,11 +18,11 @@
    - % if config['home_stats_cards']: + % elif section == 'watch_stats':
    -

    Watch Statistics Last ${config['home_stats_length']} days

    +

    Watch Statistics   Last ${config['home_stats_length']} days

    Loading stats...
    @@ -28,12 +30,11 @@
    - % endif - % if config['home_library_cards']: + % elif section == 'library_stats':
    -

    Library Statistics ${config['pms_name']}

    +

    Library Statistics   ${config['pms_name']}

    Loading stats...
    @@ -41,7 +42,7 @@
    - % endif + % elif section == 'recently_added':
    @@ -53,7 +54,10 @@ -

    Recently Added

    +

    Recently Added    + Movies   + TV Shows   + Music

    Looking for new items...
    @@ -61,6 +65,8 @@
    + % endif + % endfor
    @@ -186,6 +192,13 @@ $("#recently-added-page-right").removeClass("disabled"); } }); + + $('.toggle-recently-added-type').click(function () { + var media_type = $(this).data('type'); + var margin_right = $(this).hasClass('text-muted') ? '25px' : 0; + $('.dashboard-recent-media-instance li[data-type=' + media_type + ']').animate({ width: 'toggle', marginRight: margin_right }, 1000); + $(this).toggleClass('text-muted').blur(); + }); diff --git a/data/interfaces/default/info.html b/data/interfaces/default/info.html index ea865cea..37911ca2 100644 --- a/data/interfaces/default/info.html +++ b/data/interfaces/default/info.html @@ -119,7 +119,7 @@ DOCUMENTATION :: END % elif data['media_type'] == 'artist' or data['media_type'] == 'album' or data['media_type'] == 'track': -
    +
    diff --git a/data/interfaces/default/library_recently_added.html b/data/interfaces/default/library_recently_added.html index 12bd495f..95c421d9 100644 --- a/data/interfaces/default/library_recently_added.html +++ b/data/interfaces/default/library_recently_added.html @@ -42,32 +42,40 @@ DOCUMENTATION :: END % if item['media_type'] == 'episode': % if item['parent_thumb']:
    - % else: -
    - % endif - % elif item['media_type'] == 'movie': -
    - % endif -
    -
    - -
    -
    + % else: +
    + % endif + % elif item['media_type'] == 'movie': +
    + % endif +
    +
    +
    -
    - % if item['media_type'] == 'episode': -

    ${item['grandparent_title']}

    -

    ${item['title']}

    -

    S${item['parent_media_index']} · E${item['media_index']}

    - % elif item['media_type'] == 'movie': -

    ${item['title']}

    -

    ${item['year']}

    - % endif -
    +
    +
    +
    + % if item['media_type'] == 'episode': +

    + ${item['grandparent_title']} +

    +

    + ${item['title']} +

    +

    + S${item['parent_media_index']} · E${item['media_index']} +

    + % elif item['media_type'] == 'movie': +

    + ${item['title']} +

    +

    ${item['year']}

    + % endif +
    % elif item['media_type'] == 'album':
    @@ -82,8 +90,12 @@ DOCUMENTATION :: END
    % endif diff --git a/data/interfaces/default/login.html b/data/interfaces/default/login.html index aa2745ad..05491036 100644 --- a/data/interfaces/default/login.html +++ b/data/interfaces/default/login.html @@ -9,6 +9,8 @@ + + @@ -40,7 +42,7 @@
    diff --git a/data/interfaces/default/settings.html b/data/interfaces/default/settings.html index 7be5df0f..3a5b0033 100644 --- a/data/interfaces/default/settings.html +++ b/data/interfaces/default/settings.html @@ -20,7 +20,7 @@ available_notification_agents = sorted(notifiers.available_notification_agents()
    - Settings + Settings
    % if config['check_github']: @@ -131,10 +131,15 @@ available_notification_agents = sorted(notifiers.available_notification_agents() Gitter Chat: https://gitter.im/drzoidberg33/plexpy + + Donations: + Paypal | + Bitcoin +
    -

    PlexPy Scheduler

    +

    PlexPy Scheduled Tasks

    Loading scheduler table...
    @@ -228,7 +233,49 @@ available_notification_agents = sorted(notifiers.available_notification_agents()

    +
    +
    +

    Homepage

    +
    + + +

    + Select the sections to show on the homepage.
    + Drag the items below to reorder your homepage content. +

    +
    +
    +
      +
    • +
      + +
    • +
    • +
      + +
    • +
    • +
      + +
    • +
    • +
      + +
    • +
    + +
    +
    +

    Watch Statistics

    @@ -236,24 +283,12 @@ available_notification_agents = sorted(notifiers.available_notification_agents()

    - Select the cards to show in the watch statistics on the home page. Select none to disable.
    + Select the cards to show in the watch statistics on the home page. Drag the items below to reorder your homepage content.

      -
    • -
      - -
    • -
    • -
      - -
    • +
    • +
      + +
    • +
    • +
      + +
    @@ -2002,15 +2049,11 @@ $(document).ready(function() { $("#menu_link_update_check").click(function() { // Allow the update bar to show again if previously dismissed. setCookie('updateDismiss', 'true', 0); - $(this).html(' Checking'); + $(this).html(' Checking'); $(this).prop('disabled', true); window.location.href = "checkGithub"; }); - $("#modal_link_restart").click(function() { - window.location.href = "restart"; - }); - if ($("#api_enabled").is(":checked")) { $("#apioptions").show(); } else { @@ -2301,6 +2344,31 @@ $(document).ready(function() { var accordion_timeline = new Accordion($('#accordion-timeline'), false); var accordion_scripts = new Accordion($('#accordion-scripts'), false); + // Sortable home_sections + function set_home_sections() { + var home_sections = []; + var hsecs = $('[id^=hsec-]').serializeArray(); + $.each(hsecs, function(i, sec) { + home_sections.push(sec.value); + }); + $('#home_sections').val(home_sections); + }; + + var sec_cards = ${config['home_sections'] | n}; + sec_cards.reverse().forEach(function (item) { + $('#hsec-' + item).prop('checked', !$(this).prop('checked')) + $('#hsec-' + item).closest('li.card').prependTo('#sortable_home_sections'); + }); + + Sortable.create(sortable_home_sections, { + animation: 250, + onSort: function(elem, ui) { + set_home_sections(); + } + }); + + $('[id^=hsec-]').change(function() { set_home_sections(); }); + set_home_sections() // Sortable home_stats_cards function set_home_stats_cards() { @@ -2328,7 +2396,6 @@ $(document).ready(function() { $('[id^=hscard-]').change(function() { set_home_stats_cards(); }); set_home_stats_cards() - // Sortable home_library_cards function set_home_library_cards() { var home_library_cards = []; diff --git a/data/interfaces/default/user_recently_watched.html b/data/interfaces/default/user_recently_watched.html index 23734bcf..ab634ac8 100644 --- a/data/interfaces/default/user_recently_watched.html +++ b/data/interfaces/default/user_recently_watched.html @@ -45,17 +45,25 @@ DOCUMENTATION :: END
    -
    - % if item['media_type'] == 'episode': -

    ${item['grandparent_title']}

    -

    ${item['title']}

    -

    S${item['parent_media_index']} · E${item['media_index']}

    - % elif item['media_type'] == 'movie': -

    ${item['title']}

    -

    ${item['year']}

    - % endif -
    +
    + % if item['media_type'] == 'episode': +

    + ${item['grandparent_title']} +

    +

    + ${item['title']} +

    +

    + S${item['parent_media_index']} · E${item['media_index']} +

    + % elif item['media_type'] == 'movie': +

    + ${item['title']} +

    +

    ${item['year']}

    + % endif +
    % elif item['media_type'] == 'track':
    @@ -69,12 +77,18 @@ DOCUMENTATION :: END
    -
    -

    ${item['grandparent_title']}

    -

    ${item['title']}

    -

    ${item['parent_title']}

    -
    + % endif % endfor diff --git a/plexpy/config.py b/plexpy/config.py index 791beec3..453dcb6b 100644 --- a/plexpy/config.py +++ b/plexpy/config.py @@ -132,11 +132,12 @@ _CONFIG_DEFINITIONS = { 'GROWL_ON_EXTUP': (int, 'Growl', 0), 'GROWL_ON_INTUP': (int, 'Growl', 0), 'GROWL_ON_PMSUPDATE': (int, 'Growl', 0), + 'HOME_SECTIONS': (list, 'General', ['current_activity','watch_stats','library_stats','recently_added']), 'HOME_LIBRARY_CARDS': (list, 'General', ['first_run']), 'HOME_STATS_LENGTH': (int, 'General', 30), 'HOME_STATS_TYPE': (int, 'General', 0), 'HOME_STATS_COUNT': (int, 'General', 5), - 'HOME_STATS_CARDS': (list, 'General', ['top_tv', 'popular_tv', 'top_movies', 'popular_movies', 'top_music', \ + 'HOME_STATS_CARDS': (list, 'General', ['top_movies', 'popular_movies', 'top_tv', 'popular_tv', 'top_music', \ 'popular_music', 'last_watched', 'top_users', 'top_platforms', 'most_concurrent']), 'HTTPS_CREATE_CERT': (int, 'General', 1), 'HTTPS_CERT': (str, 'General', ''), @@ -604,4 +605,16 @@ class Config(object): if self.CONFIG_VERSION == '3': if self.HTTP_ROOT == '/': self.HTTP_ROOT = '' + self.CONFIG_VERSION = '4' + + if self.CONFIG_VERSION == '4': + print not len(self.HOME_STATS_CARDS) and 'watch_stats' in self.HOME_SECTIONS + if not len(self.HOME_STATS_CARDS) and 'watch_stats' in self.HOME_SECTIONS: + home_sections = self.HOME_SECTIONS + home_sections.remove('watch_stats') + self.HOME_SECTIONS = home_sections + if not len(self.HOME_LIBRARY_CARDS) and 'library_stats' in self.HOME_SECTIONS: + home_sections = self.HOME_SECTIONS + home_sections.remove('library_stats') + self.HOME_SECTIONS = home_sections self.CONFIG_VERSION = '4' \ No newline at end of file diff --git a/plexpy/libraries.py b/plexpy/libraries.py index 455ca7a5..cb5fbf60 100644 --- a/plexpy/libraries.py +++ b/plexpy/libraries.py @@ -711,7 +711,8 @@ class Libraries(object): try: if str(section_id).isdigit(): - query = 'SELECT session_history.id, session_history.media_type, session_history.rating_key, session_history.parent_rating_key, ' \ + query = 'SELECT session_history.id, session_history.media_type, ' \ + 'session_history.rating_key, session_history.parent_rating_key, session_history.grandparent_rating_key, ' \ 'title, parent_title, grandparent_title, thumb, parent_thumb, grandparent_thumb, media_index, parent_media_index, ' \ 'year, started, user ' \ 'FROM session_history_metadata ' \ @@ -738,6 +739,8 @@ class Libraries(object): recent_output = {'row_id': row['id'], 'media_type': row['media_type'], 'rating_key': row['rating_key'], + 'parent_rating_key': row['parent_rating_key'], + 'grandparent_rating_key': row['grandparent_rating_key'], 'title': row['title'], 'parent_title': row['parent_title'], 'grandparent_title': row['grandparent_title'], diff --git a/plexpy/users.py b/plexpy/users.py index 1fd4d637..012188d0 100644 --- a/plexpy/users.py +++ b/plexpy/users.py @@ -439,7 +439,8 @@ class Users(object): try: if str(user_id).isdigit(): - query = 'SELECT session_history.id, session_history.media_type, session_history.rating_key, session_history.parent_rating_key, ' \ + query = 'SELECT session_history.id, session_history.media_type, ' \ + 'session_history.rating_key, session_history.parent_rating_key, session_history.grandparent_rating_key, ' \ 'title, parent_title, grandparent_title, thumb, parent_thumb, grandparent_thumb, media_index, parent_media_index, ' \ 'year, started, user ' \ 'FROM session_history_metadata ' \ @@ -466,6 +467,8 @@ class Users(object): recent_output = {'row_id': row['id'], 'media_type': row['media_type'], 'rating_key': row['rating_key'], + 'parent_rating_key': row['parent_rating_key'], + 'grandparent_rating_key': row['grandparent_rating_key'], 'title': row['title'], 'parent_title': row['parent_title'], 'grandparent_title': row['grandparent_title'], diff --git a/plexpy/webserve.py b/plexpy/webserve.py index f35d647b..63f2abae 100644 --- a/plexpy/webserve.py +++ b/plexpy/webserve.py @@ -150,6 +150,7 @@ class WebInterface(object): @require() def home(self): config = { + "home_sections": plexpy.CONFIG.HOME_SECTIONS, "home_stats_length": plexpy.CONFIG.HOME_STATS_LENGTH, "home_stats_cards": plexpy.CONFIG.HOME_STATS_CARDS, "home_library_cards": plexpy.CONFIG.HOME_LIBRARY_CARDS, @@ -1290,6 +1291,7 @@ class WebInterface(object): "notify_on_pmsupdate_subject_text": plexpy.CONFIG.NOTIFY_ON_PMSUPDATE_SUBJECT_TEXT, "notify_on_pmsupdate_body_text": plexpy.CONFIG.NOTIFY_ON_PMSUPDATE_BODY_TEXT, "notify_scripts_args_text": plexpy.CONFIG.NOTIFY_SCRIPTS_ARGS_TEXT, + "home_sections": json.dumps(plexpy.CONFIG.HOME_SECTIONS), "home_stats_length": plexpy.CONFIG.HOME_STATS_LENGTH, "home_stats_type": checked(plexpy.CONFIG.HOME_STATS_TYPE), "home_stats_count": plexpy.CONFIG.HOME_STATS_COUNT, @@ -1309,15 +1311,15 @@ class WebInterface(object): checked_configs = [ "launch_browser", "enable_https", "https_create_cert", "api_enabled", "freeze_db", "check_github", - "grouping_global_history", "grouping_user_history", "grouping_charts", "pms_use_bif", "pms_ssl", + "grouping_global_history", "grouping_user_history", "grouping_charts", "group_history_tables", + "pms_use_bif", "pms_ssl", "pms_is_remote", "home_stats_type", "movie_notify_enable", "tv_notify_enable", "music_notify_enable", "monitoring_use_websocket", "tv_notify_on_start", "movie_notify_on_start", "music_notify_on_start", "tv_notify_on_stop", "movie_notify_on_stop", "music_notify_on_stop", "tv_notify_on_pause", "movie_notify_on_pause", "music_notify_on_pause", "refresh_libraries_on_startup", "refresh_users_on_startup", "ip_logging_enable", "movie_logging_enable", "tv_logging_enable", "music_logging_enable", - "pms_is_remote", "home_stats_type", "group_history_tables", "notify_consecutive", "notify_upload_posters", - "notify_recently_added", "notify_recently_added_grandparent", + "notify_consecutive", "notify_upload_posters", "notify_recently_added", "notify_recently_added_grandparent", "monitor_pms_updates", "monitor_remote_access", "get_file_sizes", "log_blacklist", "http_hash_password" ] for checked_config in checked_configs: @@ -1380,8 +1382,15 @@ class WebInterface(object): kwargs.get('https_key') != plexpy.CONFIG.HTTPS_KEY: https_changed = True + # Remove config with 'hsec-' prefix and change home_sections to list + if kwargs.get('home_sections'): + for k in kwargs.keys(): + if k.startswith('hsec-'): + del kwargs[k] + kwargs['home_sections'] = kwargs['home_sections'].split(',') + # Remove config with 'hscard-' prefix and change home_stats_cards to list - if kwargs.get('home_stats_cards', ''): + if kwargs.get('home_stats_cards'): for k in kwargs.keys(): if k.startswith('hscard-'): del kwargs[k] @@ -1391,7 +1400,7 @@ class WebInterface(object): kwargs['home_stats_cards'] = plexpy.CONFIG.HOME_STATS_CARDS # Remove config with 'hlcard-' prefix and change home_library_cards to list - if kwargs.get('home_library_cards', ''): + if kwargs.get('home_library_cards'): for k in kwargs.keys(): if k.startswith('hlcard-'): del kwargs[k]