diff --git a/data/interfaces/default/css/tautulli.css b/data/interfaces/default/css/tautulli.css index 0a823321..99c7e025 100644 --- a/data/interfaces/default/css/tautulli.css +++ b/data/interfaces/default/css/tautulli.css @@ -3746,6 +3746,7 @@ a:hover .overlay-refresh-image { a:hover .overlay-refresh-image:hover { opacity: .9; } +.smart-collection-image, .smart-playlist-image { float: left; position: absolute; diff --git a/data/interfaces/default/info.html b/data/interfaces/default/info.html index 5212d4dd..d13fb86e 100644 --- a/data/interfaces/default/info.html +++ b/data/interfaces/default/info.html @@ -229,6 +229,9 @@ DOCUMENTATION :: END
+ % if data['media_type'] == 'collection' and data['smart']: + + % endif % if _session['user_group'] == 'admin': @@ -376,7 +379,7 @@ DOCUMENTATION :: END Released ${data['year']} % elif data['media_type'] in ('photo', 'clip'): Taken ${data['originally_available_at']} - % elif data['media_type'] == 'collection': + % elif data['media_type'] == 'collection' and data['min_year'] and data['max_year']: Year ${data['min_year']} - ${data['max_year']} % elif data['year']: Year ${data['year']} diff --git a/data/interfaces/default/info_children_list.html b/data/interfaces/default/info_children_list.html index 1d474897..14f85275 100644 --- a/data/interfaces/default/info_children_list.html +++ b/data/interfaces/default/info_children_list.html @@ -41,134 +41,7 @@ DOCUMENTATION :: END % else:
  • % endif - % if data['children_type'] == 'movie': - -
    -
    - % if _session['user_group'] == 'admin': - - % endif -
    -
    -
    -

    - ${child['title']} -

    -

    ${child['year']}

    -
    - % elif data['children_type'] == 'show': - -
    -
    - % if _session['user_group'] == 'admin': - - % endif -
    -
    -
    -

    - ${child['title']} -

    -
    - % elif data['children_type'] == 'season': - -
    - % if child['thumb']: -
    - % else: -
    - % endif -
    -
    - ${child['title']} -
    -
    -
    - % if _session['user_group'] == 'admin': - - % endif -
    -
    - % elif data['children_type'] == 'episode': - -
    -
    -
    -
    - Episode ${child['media_index'] or child['originally_available_at']} -
    -
    -
    - % if _session['user_group'] == 'admin': - - % endif -
    -
    - - % elif data['children_type'] == 'album': - -
    -
    - % if _session['user_group'] == 'admin': - - % endif -
    -
    - - % elif data['children_type'] == 'track': - <% e = 'even' if loop.index % 2 == 0 else 'odd' %> -
    - ${child['media_index']} - - - - - ${child['title']} - - - % if child['original_title']: - - ${child['original_title']} - % endif - - - <% f = 'h:mm:ss' if cast_to_int(child['duration']) >= 3600000 else 'm:ss' %> - - -
    - % elif data['children_type'] == 'photo': - <% e = 'even' if loop.index % 2 == 0 else 'odd' %> -
    - ${loop.index + 1} - - % if child['media_type'] == 'photo_album': - - % elif child['media_type'] == 'clip': - - % else: - - % endif - - - ${child['title']} - - - - % if child['duration']: - - <% f = 'h:mm:ss' if cast_to_int(child['duration']) >= 3600000 else 'm:ss' %> - - - % endif -
    - % elif media_type == 'playlist': + % if media_type == 'playlist': <% e = 'even' if loop.index % 2 == 0 else 'odd' %>
    ${loop.index + 1} @@ -239,6 +112,133 @@ DOCUMENTATION :: END % endif
    + % elif child['media_type'] == 'movie': + +
    +
    + % if _session['user_group'] == 'admin': + + % endif +
    +
    +
    +

    + ${child['title']} +

    +

    ${child['year']}

    +
    + % elif child['media_type'] == 'show': + +
    +
    + % if _session['user_group'] == 'admin': + + % endif +
    +
    + + % elif child['media_type'] == 'season': + +
    + % if child['thumb']: +
    + % else: +
    + % endif +
    +
    + ${child['title']} +
    +
    +
    + % if _session['user_group'] == 'admin': + + % endif +
    +
    + % elif child['media_type'] == 'episode': + +
    +
    +
    +
    + Episode ${child['media_index'] or child['originally_available_at']} +
    +
    +
    + % if _session['user_group'] == 'admin': + + % endif +
    +
    + + % elif child['media_type'] == 'album': + +
    +
    + % if _session['user_group'] == 'admin': + + % endif +
    +
    + + % elif child['media_type'] == 'track': + <% e = 'even' if loop.index % 2 == 0 else 'odd' %> +
    + ${child['media_index']} + + + + + ${child['title']} + + + % if child['original_title']: + - ${child['original_title']} + % endif + + + <% f = 'h:mm:ss' if cast_to_int(child['duration']) >= 3600000 else 'm:ss' %> + + +
    + % elif child['media_type'] == 'photo': + <% e = 'even' if loop.index % 2 == 0 else 'odd' %> +
    + ${loop.index + 1} + + % if child['media_type'] == 'photo_album': + + % elif child['media_type'] == 'clip': + + % else: + + % endif + + + ${child['title']} + + + + % if child['duration']: + + <% f = 'h:mm:ss' if cast_to_int(child['duration']) >= 3600000 else 'm:ss' %> + + + % endif +
    % endif
  • % endif diff --git a/plexpy/pmsconnect.py b/plexpy/pmsconnect.py index faf518c1..4f893beb 100644 --- a/plexpy/pmsconnect.py +++ b/plexpy/pmsconnect.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# -*- coding: utf-8 -*- # This file is part of Tautulli. # @@ -144,7 +144,7 @@ class PmsConnect(object): return request - def get_metadata_children(self, rating_key='', output_format=''): + def get_metadata_children(self, rating_key='', collection=False, output_format=''): """ Return metadata for children of the request item. @@ -153,7 +153,9 @@ class PmsConnect(object): Output: array """ - uri = '/library/metadata/' + rating_key + '/children' + uri = '/library/{}/{}/children'.format( + 'collections' if collection else 'metadata', rating_key + ) request = self.request_handler.make_request(uri=uri, request_type='GET', output_format=output_format) @@ -1273,7 +1275,8 @@ class PmsConnect(object): 'guids': guids, 'full_title': helpers.get_xml_attr(metadata_main, 'title'), 'children_count': helpers.cast_to_int(helpers.get_xml_attr(metadata_main, 'childCount')), - 'live': int(helpers.get_xml_attr(metadata_main, 'live') == '1') + 'live': int(helpers.get_xml_attr(metadata_main, 'live') == '1'), + 'smart': helpers.cast_to_int(helpers.get_xml_attr(metadata_main, 'smart')) } elif metadata_type == 'playlist': @@ -2297,6 +2300,8 @@ class PmsConnect(object): if media_type == 'playlist': children_data = self.get_playlist_items(rating_key, output_format='xml') + elif media_type == 'collection': + children_data = self.get_metadata_children(rating_key, collection=True, output_format='xml') elif get_grandchildren: children_data = self.get_metadata_grandchildren(rating_key, output_format='xml') else: