<%doc> USAGE DOCUMENTATION :: PLEASE LEAVE THIS AT THE TOP OF THIS FILE For Mako templating syntax documentation please visit: http://docs.makotemplates.org/en/latest/ Filename: library_stats.html Version: 0.1 Variable names: data [array] data[array_index] :: Usable parameters data Returns an array containing stat data data[array_index] :: Usable parameters section_name Returns the title of the library. section_type Returns the type of the library. thumb Returns the thumb of the library. count Returns the number of top level items in the library. parent_count Returns the number of parent items in the library. child_count Returns the number of child items in the library. DOCUMENTATION :: END % if data: <% from plexpy.helpers import page types = ('movie', 'show', 'artist', 'photo') headers = {'movie': ('Movie Libraries', ('Movies', '', '')), 'show': ('TV Show Libraries', ('Shows', 'Seasons', 'Episodes')), 'artist': ('Music Libraries', ('Artists', 'Albums', 'Tracks')), 'photo': ('Photo Libraries', ('Albums', 'Photos', 'Videos'))} %> % for section_type in types: % if section_type in data: <% row0 = data[section_type][0] %>
% if row0['thumb'].startswith('http'):
% else:
% endif

#### ${headers[section_type][0]}

${' / '.join(u for u in headers[section_type][1] if u)}

% for section in data[section_type]:
- ${loop.index + 1}
  ${section['section_name']}
  % if headers[section_type][1][0]:
  ${section['count']}
  % endif % if headers[section_type][1][1]:
  /
  ${section['child_count']}
  % endif % if headers[section_type][1][2]:
  /
  ${section['grandchild_count']}
  % endif
% endfor

% endif % endfor % else:
No stats to show.
% endif