From 15e928ecf2e303290c25a9a86f01923d84c7becb Mon Sep 17 00:00:00 2001 From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> Date: Thu, 1 Oct 2020 09:57:01 -0700 Subject: [PATCH] Add items suffix to collections and playlist table --- data/interfaces/default/info.html | 24 ++++++++++++------- data/interfaces/default/js/script.js | 13 ++++++++++ .../default/js/tables/collections_table.js | 6 ++++- .../default/js/tables/playlists_table.js | 6 ++++- plexpy/common.py | 3 +++ plexpy/pmsconnect.py | 2 +- 6 files changed, 43 insertions(+), 11 deletions(-) diff --git a/data/interfaces/default/info.html b/data/interfaces/default/info.html index cd20164b..30e78013 100644 --- a/data/interfaces/default/info.html +++ b/data/interfaces/default/info.html @@ -303,6 +303,19 @@ DOCUMENTATION :: END % endif % endif +
+ % if data['media_type'] in ('collection', 'playlist') and data['children_count']: + <% + if data['media_type'] == 'collection': + suffix = MEDIA_TYPE_HEADERS[data['sub_media_type']] + elif data['media_type'] == 'playlist': + suffix = MEDIA_TYPE_HEADERS[data['playlist_type']] + if data['children_count'] == 1: + suffix = suffix[:-1] + %> + Items ${data['children_count']} ${suffix} + % endif +
% if data['directors']: Directed by ${data['directors'][0]} @@ -328,11 +341,6 @@ DOCUMENTATION :: END Year ${data['year']} % endif
-
- % if data['duration']: - Items ${data['children_count']} ${'track' if data['playlist_type'] == 'audio' else 'video'}${'s' if data['children_count'] > 1 else ''} - % endif -
% if data['duration']: Runtime ${data['duration']} @@ -459,7 +467,7 @@ DOCUMENTATION :: END
-
  Loading movies list...
+
  Loading collection items...