mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-16 02:02:58 -07:00
Move live key to main metadata dict
This commit is contained in:
parent
af521b4058
commit
ba465a0d15
3 changed files with 35 additions and 23 deletions
|
@ -85,7 +85,7 @@ DOCUMENTATION :: END
|
|||
<div class="col-md-12">
|
||||
<div class="summary-navbar-list">
|
||||
<ul class="list-unstyled breadcrumb">
|
||||
% if media_info['live']:
|
||||
% if data['live']:
|
||||
<li>Live TV</li>
|
||||
<span class="breadcrumb-arrow"><i class="fa fa-chevron-right"></i></span>
|
||||
% if data['media_type'] == 'movie':
|
||||
|
@ -151,10 +151,10 @@ DOCUMENTATION :: END
|
|||
<div class="summary-content-poster hidden-xs hidden-sm">
|
||||
% if data['media_type'] == 'track':
|
||||
<a href="${config['pms_web_url']}#!/server/${config['pms_identifier']}/details?key=%2Flibrary%2Fmetadata%2F${data['parent_rating_key']}" target="_blank" title="View on Plex Web">
|
||||
% elif not media_info['live']:
|
||||
% elif not data['live']:
|
||||
<a href="${config['pms_web_url']}#!/server/${config['pms_identifier']}/details?key=%2Flibrary%2Fmetadata%2F${data['rating_key']}" target="_blank" title="View on Plex Web">
|
||||
% endif
|
||||
% if media_info['live']:
|
||||
% if data['live']:
|
||||
<div class="summary-poster-face" style="background-image: url(pms_image_proxy?img=${data['grandparent_thumb'] or data['thumb']}&rating_key=${data['rating_key']}&width=300&height=450&fallback=poster-live);">
|
||||
<div class="summary-poster-face-overlay">
|
||||
<span></span>
|
||||
|
@ -190,12 +190,12 @@ DOCUMENTATION :: END
|
|||
% endif
|
||||
% endif
|
||||
% endif
|
||||
% if not media_info['live']:
|
||||
% if not data['live']:
|
||||
</a>
|
||||
% endif
|
||||
</div>
|
||||
<div class="summary-content-title">
|
||||
% if media_info['live']:
|
||||
% if data['live']:
|
||||
% if data['media_type'] == 'movie':
|
||||
<h1> </h1><h1>${data['title']}</h1>
|
||||
% elif data['media_type'] == 'episode':
|
||||
|
@ -227,7 +227,7 @@ DOCUMENTATION :: END
|
|||
</div>
|
||||
<div class="summary-content-wrapper">
|
||||
<div class="col-md-9">
|
||||
% if data['media_type'] == 'movie' or media_info['live']:
|
||||
% if data['media_type'] == 'movie' or data['live']:
|
||||
<div class="summary-content-padding hidden-xs hidden-sm" style="height: 305px;">
|
||||
% elif data['media_type'] in ('show', 'season', 'collection'):
|
||||
<div class="summary-content-padding hidden-xs hidden-sm" style="height: 270px;">
|
||||
|
@ -476,7 +476,7 @@ DOCUMENTATION :: END
|
|||
</span>
|
||||
</div>
|
||||
% endif
|
||||
% if not media_info['live']:
|
||||
% if not data['live']:
|
||||
<div class="btn-group">
|
||||
<button class="btn btn-dark" data-toggle="modal" aria-pressed="false" autocomplete="off" id="send-recently-added-notification"
|
||||
data-id="${data['rating_key']}">
|
||||
|
|
|
@ -1077,7 +1077,6 @@ class DataFactory(object):
|
|||
'video_framerate': item['video_framerate'],
|
||||
'audio_codec': item['audio_codec'],
|
||||
'audio_channels': item['audio_channels'],
|
||||
'live': item['live'],
|
||||
'channel_call_sign': item['channel_call_sign'],
|
||||
'channel_identifier': item['channel_identifier'],
|
||||
'channel_thumb': item['channel_thumb']
|
||||
|
@ -1116,6 +1115,7 @@ class DataFactory(object):
|
|||
'labels': labels,
|
||||
'library_name': section_name,
|
||||
'section_id': item['section_id'],
|
||||
'live': item['live'],
|
||||
'media_info': media_info
|
||||
}
|
||||
metadata_list.append(metadata)
|
||||
|
|
|
@ -719,7 +719,8 @@ class PmsConnect(object):
|
|||
'labels': labels,
|
||||
'collections': collections,
|
||||
'full_title': helpers.get_xml_attr(metadata_main, 'title'),
|
||||
'children_count': helpers.get_xml_attr(metadata_main, 'leafCount')
|
||||
'children_count': helpers.get_xml_attr(metadata_main, 'leafCount'),
|
||||
'live': int(helpers.get_xml_attr(metadata_main, 'live') == '1')
|
||||
}
|
||||
|
||||
elif metadata_type == 'show':
|
||||
|
@ -771,7 +772,8 @@ class PmsConnect(object):
|
|||
'labels': labels,
|
||||
'collections': collections,
|
||||
'full_title': helpers.get_xml_attr(metadata_main, 'title'),
|
||||
'children_count': helpers.get_xml_attr(metadata_main, 'leafCount')
|
||||
'children_count': helpers.get_xml_attr(metadata_main, 'leafCount'),
|
||||
'live': int(helpers.get_xml_attr(metadata_main, 'live') == '1')
|
||||
}
|
||||
|
||||
elif metadata_type == 'season':
|
||||
|
@ -821,7 +823,8 @@ class PmsConnect(object):
|
|||
'collections': show_details.get('collections', []),
|
||||
'full_title': u'{} - {}'.format(helpers.get_xml_attr(metadata_main, 'parentTitle'),
|
||||
helpers.get_xml_attr(metadata_main, 'title')),
|
||||
'children_count': helpers.get_xml_attr(metadata_main, 'leafCount')
|
||||
'children_count': helpers.get_xml_attr(metadata_main, 'leafCount'),
|
||||
'live': int(helpers.get_xml_attr(metadata_main, 'live') == '1')
|
||||
}
|
||||
|
||||
elif metadata_type == 'episode':
|
||||
|
@ -887,7 +890,8 @@ class PmsConnect(object):
|
|||
'collections': show_details.get('collections', []),
|
||||
'full_title': u'{} - {}'.format(helpers.get_xml_attr(metadata_main, 'grandparentTitle'),
|
||||
helpers.get_xml_attr(metadata_main, 'title')),
|
||||
'children_count': helpers.get_xml_attr(metadata_main, 'leafCount')
|
||||
'children_count': helpers.get_xml_attr(metadata_main, 'leafCount'),
|
||||
'live': int(helpers.get_xml_attr(metadata_main, 'live') == '1')
|
||||
}
|
||||
|
||||
elif metadata_type == 'artist':
|
||||
|
@ -934,7 +938,8 @@ class PmsConnect(object):
|
|||
'labels': labels,
|
||||
'collections': collections,
|
||||
'full_title': helpers.get_xml_attr(metadata_main, 'title'),
|
||||
'children_count': helpers.get_xml_attr(metadata_main, 'leafCount')
|
||||
'children_count': helpers.get_xml_attr(metadata_main, 'leafCount'),
|
||||
'live': int(helpers.get_xml_attr(metadata_main, 'live') == '1')
|
||||
}
|
||||
|
||||
elif metadata_type == 'album':
|
||||
|
@ -984,7 +989,8 @@ class PmsConnect(object):
|
|||
'collections': collections,
|
||||
'full_title': u'{} - {}'.format(helpers.get_xml_attr(metadata_main, 'parentTitle'),
|
||||
helpers.get_xml_attr(metadata_main, 'title')),
|
||||
'children_count': helpers.get_xml_attr(metadata_main, 'leafCount')
|
||||
'children_count': helpers.get_xml_attr(metadata_main, 'leafCount'),
|
||||
'live': int(helpers.get_xml_attr(metadata_main, 'live') == '1')
|
||||
}
|
||||
|
||||
elif metadata_type == 'track':
|
||||
|
@ -1036,7 +1042,8 @@ class PmsConnect(object):
|
|||
'collections': album_details.get('collections', []),
|
||||
'full_title': u'{} - {}'.format(helpers.get_xml_attr(metadata_main, 'title'),
|
||||
track_artist),
|
||||
'children_count': helpers.get_xml_attr(metadata_main, 'leafCount')
|
||||
'children_count': helpers.get_xml_attr(metadata_main, 'leafCount'),
|
||||
'live': int(helpers.get_xml_attr(metadata_main, 'live') == '1')
|
||||
}
|
||||
|
||||
elif metadata_type == 'photo_album':
|
||||
|
@ -1083,7 +1090,8 @@ class PmsConnect(object):
|
|||
'labels': labels,
|
||||
'collections': collections,
|
||||
'full_title': helpers.get_xml_attr(metadata_main, 'title'),
|
||||
'children_count': helpers.get_xml_attr(metadata_main, 'leafCount')
|
||||
'children_count': helpers.get_xml_attr(metadata_main, 'leafCount'),
|
||||
'live': int(helpers.get_xml_attr(metadata_main, 'live') == '1')
|
||||
}
|
||||
|
||||
elif metadata_type == 'photo':
|
||||
|
@ -1133,7 +1141,8 @@ class PmsConnect(object):
|
|||
'collections': photo_album_details.get('collections', []),
|
||||
'full_title': u'{} - {}'.format(helpers.get_xml_attr(metadata_main, 'parentTitle') or library_name,
|
||||
helpers.get_xml_attr(metadata_main, 'title')),
|
||||
'children_count': helpers.get_xml_attr(metadata_main, 'leafCount')
|
||||
'children_count': helpers.get_xml_attr(metadata_main, 'leafCount'),
|
||||
'live': int(helpers.get_xml_attr(metadata_main, 'live') == '1')
|
||||
}
|
||||
|
||||
elif metadata_type == 'collection':
|
||||
|
@ -1184,7 +1193,8 @@ class PmsConnect(object):
|
|||
'labels': labels,
|
||||
'collections': collections,
|
||||
'full_title': helpers.get_xml_attr(metadata_main, 'title'),
|
||||
'children_count': helpers.get_xml_attr(metadata_main, 'leafCount')
|
||||
'children_count': helpers.get_xml_attr(metadata_main, 'leafCount'),
|
||||
'live': int(helpers.get_xml_attr(metadata_main, 'live') == '1')
|
||||
}
|
||||
|
||||
elif metadata_type == 'clip':
|
||||
|
@ -1232,12 +1242,17 @@ class PmsConnect(object):
|
|||
'collections': collections,
|
||||
'full_title': helpers.get_xml_attr(metadata_main, 'title'),
|
||||
'extra_type': helpers.get_xml_attr(metadata_main, 'extraType'),
|
||||
'sub_type': helpers.get_xml_attr(metadata_main, 'subtype')
|
||||
'sub_type': helpers.get_xml_attr(metadata_main, 'subtype'),
|
||||
'live': int(helpers.get_xml_attr(metadata_main, 'live') == '1')
|
||||
}
|
||||
|
||||
else:
|
||||
return metadata
|
||||
|
||||
# Fake Live TV air date using added_at timestamp
|
||||
if metadata['live'] and not metadata['originally_available_at']:
|
||||
metadata['originally_available_at'] = helpers.timestamp_to_iso_date(metadata['added_at'])
|
||||
|
||||
if metadata and media_info:
|
||||
medias = []
|
||||
media_items = metadata_main.getElementsByTagName('Media')
|
||||
|
@ -1342,10 +1357,7 @@ class PmsConnect(object):
|
|||
'parts': parts
|
||||
}
|
||||
|
||||
live = int(helpers.get_xml_attr(metadata_main, 'live') == '1')
|
||||
|
||||
if live:
|
||||
media_info['live'] = live
|
||||
if metadata['live']:
|
||||
media_info['channel_call_sign'] = helpers.get_xml_attr(media, 'channelCallSign')
|
||||
media_info['channel_identifier'] = helpers.get_xml_attr(media, 'channelIdentifier')
|
||||
media_info['channel_thumb'] = helpers.get_xml_attr(media, 'channelThumb')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue