Compare commits
9 Commits
v2.1.35-be
...
v2.1.36-be
Author | SHA1 | Date | |
---|---|---|---|
![]() |
27d2c7b078 | ||
![]() |
2fb12ccf65 | ||
![]() |
cb92d159c1 | ||
![]() |
64bdf4237c | ||
![]() |
fd7b4ec7e3 | ||
![]() |
57eb57d4d7 | ||
![]() |
7974e9505b | ||
![]() |
7498fb37b5 | ||
![]() |
2cc3e88e6c |
6
API.md
6
API.md
@@ -416,6 +416,7 @@ Returns:
|
||||
"Drama",
|
||||
"Fantasy"
|
||||
],
|
||||
"grandparent_guid": "com.plexapp.agents.thetvdb://121361?lang=en",
|
||||
"grandparent_rating_key": "1219",
|
||||
"grandparent_thumb": "/library/metadata/1219/thumb/1503306930",
|
||||
"grandparent_title": "Game of Thrones",
|
||||
@@ -443,6 +444,7 @@ Returns:
|
||||
"optimized_version_title": "",
|
||||
"originally_available_at": "2016-04-24",
|
||||
"original_title": "",
|
||||
"parent_guid": "com.plexapp.agents.thetvdb://121361/6?lang=en",
|
||||
"parent_media_index": "6",
|
||||
"parent_rating_key": "153036",
|
||||
"parent_thumb": "/library/metadata/153036/thumb/1503889210",
|
||||
@@ -1114,6 +1116,7 @@ Returns:
|
||||
"Drama",
|
||||
"Fantasy"
|
||||
],
|
||||
"grandparent_guid": "com.plexapp.agents.thetvdb://121361?lang=en",
|
||||
"grandparent_rating_key": "1219",
|
||||
"grandparent_thumb": "/library/metadata/1219/thumb/1462175063",
|
||||
"grandparent_title": "Game of Thrones",
|
||||
@@ -1154,6 +1157,7 @@ Returns:
|
||||
"video_language_code": "",
|
||||
"video_profile": "high",
|
||||
"video_ref_frames": "4",
|
||||
"video_scan_type": "progressive",
|
||||
"video_width": "1920",
|
||||
"selected": 0
|
||||
},
|
||||
@@ -1188,6 +1192,7 @@ Returns:
|
||||
],
|
||||
"video_codec": "h264",
|
||||
"video_framerate": "24p",
|
||||
"video_full_resolution": "1080p",
|
||||
"video_profile": "high",
|
||||
"video_resolution": "1080",
|
||||
"width": "1920"
|
||||
@@ -1196,6 +1201,7 @@ Returns:
|
||||
"media_type": "episode",
|
||||
"original_title": "",
|
||||
"originally_available_at": "2016-04-24",
|
||||
"parent_guid": "com.plexapp.agents.thetvdb://121361/6?lang=en",
|
||||
"parent_media_index": "6",
|
||||
"parent_rating_key": "153036",
|
||||
"parent_thumb": "/library/metadata/153036/thumb/1462175062",
|
||||
|
12
CHANGELOG.md
12
CHANGELOG.md
@@ -1,5 +1,17 @@
|
||||
# Changelog
|
||||
|
||||
## v2.1.36-beta (2019-10-05)
|
||||
|
||||
* Monitoring:
|
||||
* Fix: Activity card title not updating after pre-rolls or auto-play.
|
||||
* History:
|
||||
* Fix: Display correct interlaced or progressive video scan type on stream data modal.
|
||||
* Graphs:
|
||||
* New: Separate interlaced and progressive video scan type on source and stream resolution graphs.
|
||||
* API:
|
||||
* New: Added parent_guid and grandparent_guid to get_activity and get_metadata commands.
|
||||
|
||||
|
||||
## v2.1.35-beta (2019-09-24)
|
||||
|
||||
* Monitoring:
|
||||
|
@@ -355,8 +355,9 @@
|
||||
var session_id = s.session_id;
|
||||
var instance = $('#activity-instance-' + key);
|
||||
|
||||
// Create a new instance if it doesn't exist
|
||||
if (!(instance.length)) {
|
||||
// Create a new instance if it doesn't exist or recreate the entire instance
|
||||
// if the rating key changed (for movies or episodes) with the same session key
|
||||
if (!(instance.length) || (s.media_type !== 'track' && s.rating_key !== instance.data('rating_key').toString())) {
|
||||
create_instances.push(key);
|
||||
getActivityInstance(key);
|
||||
return;
|
||||
@@ -382,7 +383,7 @@
|
||||
// Switching tracks can be under the same session key, so need to update the info.
|
||||
if (s.media_type === 'track') {
|
||||
// Update if artist changed
|
||||
if (s.grandparent_rating_key !== instance.data('grandparent_rating_key')) {
|
||||
if (s.grandparent_rating_key !== instance.data('grandparent_rating_key').toString()) {
|
||||
$('#background-' + key).css('background-image', 'url(pms_image_proxy?img=' + s.art + '&width=500&height=280&opacity=40&background=282828&blur=3&fallback=art&refresh=true)');
|
||||
$('#metadata-grandparent_title-' + key)
|
||||
.attr('href', 'info?rating_key=' + s.grandparent_rating_key)
|
||||
@@ -390,7 +391,7 @@
|
||||
.text(s.original_title || s.grandparent_title);
|
||||
}
|
||||
// Update cover if album changed
|
||||
if (s.parent_rating_key !== instance.data('parent_rating_key')) {
|
||||
if (s.parent_rating_key !== instance.data('parent_rating_key').toString()) {
|
||||
$('#poster-' + key).css('background-image', 'url(pms_image_proxy?img=' + s.parent_thumb + '&width=300&height=300&fallback=poster&refresh=true)');
|
||||
$('#poster-' + key + '-bg').css('background-image', 'url(pms_image_proxy?img=' + s.parent_thumb + '&width=300&height=300&opacity=60&background=282828&blur=3&fallback=poster&refresh=true)');
|
||||
$('#poster-url-' + key)
|
||||
@@ -402,7 +403,7 @@
|
||||
.text(s.parent_title);
|
||||
}
|
||||
// Update cover if track changed
|
||||
if (s.rating_key !== instance.data('rating_key')) {
|
||||
if (s.rating_key !== instance.data('rating_key').toString()) {
|
||||
$('#metadata-grandparent_title-' + key)
|
||||
.attr('href', 'info?rating_key=' + s.grandparent_rating_key)
|
||||
.attr('title', s.original_title || s.grandparent_title)
|
||||
@@ -580,7 +581,14 @@
|
||||
session_key: session_key
|
||||
},
|
||||
complete: function(xhr, status) {
|
||||
$('#currentActivity').append(xhr.responseText);
|
||||
var instance = $('#activity-instance-' + session_key);
|
||||
|
||||
if (instance.length) {
|
||||
instance.replaceWith(xhr.responseText);
|
||||
} else {
|
||||
$('#currentActivity').append(xhr.responseText);
|
||||
}
|
||||
|
||||
$('#activity-instance-' + session_key + ' .dashboard-activity-info-scroller').scrollbar();
|
||||
$('#activity-instance-' + session_key + ' [data-toggle=tooltip]').tooltip({ container: 'body', placement: 'right', delay: 50 });
|
||||
$('#terminate-button-' + session_key).tooltip('destroy').tooltip({ container: 'body', placement: 'left', delay: 50 });
|
||||
|
@@ -50,7 +50,7 @@ media_info_table_options = {
|
||||
expand_details = '<span class="expand-media-info-tooltip" data-toggle="tooltip" title="Show Episodes"><i class="fa fa-plus-circle fa-fw"></i></span>';
|
||||
$(td).html('<div><a href="#"><div style="float: left;">' + expand_details + ' ' + date + '</div></a></div>');
|
||||
} else if (rowData['media_type'] === 'artist') {
|
||||
expand_details = '<span class="expand-media-info-tooltip" data-toggle="tooltip" title="Show Albumns"><i class="fa fa-plus-circle fa-fw"></i></span>';
|
||||
expand_details = '<span class="expand-media-info-tooltip" data-toggle="tooltip" title="Show Albums"><i class="fa fa-plus-circle fa-fw"></i></span>';
|
||||
$(td).html('<div><a href="#"><div style="float: left;">' + expand_details + ' ' + date + '</div></a></div>');
|
||||
} else if (rowData['media_type'] === 'album') {
|
||||
expand_details = '<span class="expand-media-info-tooltip" data-toggle="tooltip" title="Show Tracks"><i class="fa fa-plus-circle fa-fw"></i></span>';
|
||||
|
@@ -96,8 +96,8 @@ DOCUMENTATION :: END
|
||||
% if data['media_type'] != 'track':
|
||||
<tr>
|
||||
<td>Resolution</td>
|
||||
<td>${VIDEO_RESOLUTION_OVERRIDES.get(data['stream_video_resolution'], data['stream_video_resolution'])}</td>
|
||||
<td>${VIDEO_RESOLUTION_OVERRIDES.get(data['video_resolution'], data['video_resolution'])}</td>
|
||||
<td>${data['stream_video_full_resolution']}</td>
|
||||
<td>${data['video_full_resolution']}</td>
|
||||
</tr>
|
||||
% endif
|
||||
<tr>
|
||||
|
@@ -582,12 +582,12 @@ def dbcheck():
|
||||
'view_offset INTEGER DEFAULT 0, duration INTEGER, video_decision TEXT, audio_decision TEXT, '
|
||||
'transcode_decision TEXT, container TEXT, bitrate INTEGER, width INTEGER, height INTEGER, '
|
||||
'video_codec TEXT, video_bitrate INTEGER, video_resolution TEXT, video_width INTEGER, video_height INTEGER, '
|
||||
'video_framerate TEXT, aspect_ratio TEXT, '
|
||||
'video_framerate TEXT, video_scan_type TEXT, video_full_resolution TEXT, aspect_ratio TEXT, '
|
||||
'audio_codec TEXT, audio_bitrate INTEGER, audio_channels INTEGER, subtitle_codec TEXT, '
|
||||
'stream_bitrate INTEGER, stream_video_resolution TEXT, quality_profile TEXT, '
|
||||
'stream_container_decision TEXT, stream_container TEXT, '
|
||||
'stream_video_decision TEXT, stream_video_codec TEXT, stream_video_bitrate INTEGER, stream_video_width INTEGER, '
|
||||
'stream_video_height INTEGER, stream_video_framerate TEXT, '
|
||||
'stream_video_height INTEGER, stream_video_framerate TEXT, stream_video_scan_type TEXT, stream_video_full_resolution TEXT, '
|
||||
'stream_audio_decision TEXT, stream_audio_codec TEXT, stream_audio_bitrate INTEGER, stream_audio_channels INTEGER, '
|
||||
'subtitles INTEGER, stream_subtitle_decision TEXT, stream_subtitle_codec TEXT, '
|
||||
'transcode_protocol TEXT, transcode_container TEXT, '
|
||||
@@ -617,7 +617,7 @@ def dbcheck():
|
||||
'video_decision TEXT, audio_decision TEXT, transcode_decision TEXT, duration INTEGER DEFAULT 0, '
|
||||
'container TEXT, bitrate INTEGER, width INTEGER, height INTEGER, video_bitrate INTEGER, video_bit_depth INTEGER, '
|
||||
'video_codec TEXT, video_codec_level TEXT, video_width INTEGER, video_height INTEGER, video_resolution TEXT, '
|
||||
'video_framerate TEXT, aspect_ratio TEXT, '
|
||||
'video_framerate TEXT, video_scan_type TEXT, video_full_resolution TEXT, aspect_ratio TEXT, '
|
||||
'audio_bitrate INTEGER, audio_codec TEXT, audio_channels INTEGER, transcode_protocol TEXT, '
|
||||
'transcode_container TEXT, transcode_video_codec TEXT, transcode_audio_codec TEXT, '
|
||||
'transcode_audio_channels INTEGER, transcode_width INTEGER, transcode_height INTEGER, '
|
||||
@@ -627,7 +627,7 @@ def dbcheck():
|
||||
'stream_container TEXT, stream_container_decision TEXT, stream_bitrate INTEGER, '
|
||||
'stream_video_decision TEXT, stream_video_bitrate INTEGER, stream_video_codec TEXT, stream_video_codec_level TEXT, '
|
||||
'stream_video_bit_depth INTEGER, stream_video_height INTEGER, stream_video_width INTEGER, stream_video_resolution TEXT, '
|
||||
'stream_video_framerate TEXT, '
|
||||
'stream_video_framerate TEXT, stream_video_scan_type TEXT, stream_video_full_resolution TEXT, '
|
||||
'stream_audio_decision TEXT, stream_audio_codec TEXT, stream_audio_bitrate INTEGER, stream_audio_channels INTEGER, '
|
||||
'stream_subtitle_decision TEXT, stream_subtitle_codec TEXT, stream_subtitle_container TEXT, stream_subtitle_forced INTEGER, '
|
||||
'subtitles INTEGER, subtitle_codec TEXT, synced_version INTEGER, synced_version_profile TEXT, '
|
||||
@@ -1175,6 +1175,24 @@ def dbcheck():
|
||||
'ALTER TABLE sessions ADD COLUMN rating_key_websocket TEXT'
|
||||
)
|
||||
|
||||
# Upgrade sessions table from earlier versions
|
||||
try:
|
||||
c_db.execute('SELECT video_scan_type FROM sessions')
|
||||
except sqlite3.OperationalError:
|
||||
logger.debug(u"Altering database. Updating database table sessions.")
|
||||
c_db.execute(
|
||||
'ALTER TABLE sessions ADD COLUMN video_scan_type TEXT'
|
||||
)
|
||||
c_db.execute(
|
||||
'ALTER TABLE sessions ADD COLUMN video_full_resolution TEXT'
|
||||
)
|
||||
c_db.execute(
|
||||
'ALTER TABLE sessions ADD COLUMN stream_video_scan_type TEXT'
|
||||
)
|
||||
c_db.execute(
|
||||
'ALTER TABLE sessions ADD COLUMN stream_video_full_resolution TEXT'
|
||||
)
|
||||
|
||||
# Upgrade session_history table from earlier versions
|
||||
try:
|
||||
c_db.execute('SELECT reference_id FROM session_history')
|
||||
@@ -1474,6 +1492,45 @@ def dbcheck():
|
||||
except sqlite3.OperationalError:
|
||||
logger.warn(u"Unable to remove NULL values from session_history_media_info table.")
|
||||
|
||||
# Upgrade session_history_media_info table from earlier versions
|
||||
try:
|
||||
c_db.execute('SELECT video_scan_type FROM session_history_media_info')
|
||||
except sqlite3.OperationalError:
|
||||
logger.debug(u"Altering database. Updating database table session_history_media_info.")
|
||||
c_db.execute(
|
||||
'ALTER TABLE session_history_media_info ADD COLUMN video_scan_type TEXT'
|
||||
)
|
||||
c_db.execute(
|
||||
'ALTER TABLE session_history_media_info ADD COLUMN video_full_resolution TEXT'
|
||||
)
|
||||
c_db.execute(
|
||||
'ALTER TABLE session_history_media_info ADD COLUMN stream_video_scan_type TEXT'
|
||||
)
|
||||
c_db.execute(
|
||||
'ALTER TABLE session_history_media_info ADD COLUMN stream_video_full_resolution TEXT'
|
||||
)
|
||||
c_db.execute(
|
||||
'UPDATE session_history_media_info SET video_scan_type = "progressive" '
|
||||
'WHERE video_resolution != ""'
|
||||
)
|
||||
c_db.execute(
|
||||
'UPDATE session_history_media_info SET stream_video_scan_type = "progressive" '
|
||||
'WHERE stream_video_resolution != "" AND stream_video_resolution IS NOT NULL'
|
||||
)
|
||||
c_db.execute(
|
||||
'UPDATE session_history_media_info SET video_full_resolution = (CASE '
|
||||
'WHEN video_resolution = "" OR video_resolution = "SD" OR video_resolution = "4k" THEN video_resolution '
|
||||
'WHEN video_resolution = "sd" THEN "SD" '
|
||||
'ELSE video_resolution || "p" END)'
|
||||
)
|
||||
c_db.execute(
|
||||
'UPDATE session_history_media_info SET stream_video_full_resolution = ( '
|
||||
'CASE WHEN stream_video_resolution = "" OR stream_video_resolution = "SD" OR stream_video_resolution = "4k" '
|
||||
'THEN stream_video_resolution '
|
||||
'WHEN stream_video_resolution = "sd" THEN "SD" '
|
||||
'ELSE stream_video_resolution || "p" END)'
|
||||
)
|
||||
|
||||
# Upgrade users table from earlier versions
|
||||
try:
|
||||
c_db.execute('SELECT do_notify FROM users')
|
||||
|
@@ -76,6 +76,8 @@ class ActivityProcessor(object):
|
||||
'video_height': session.get('video_height', ''),
|
||||
'video_resolution': session.get('video_resolution', ''),
|
||||
'video_framerate': session.get('video_framerate', ''),
|
||||
'video_scan_type': session.get('video_scan_type', ''),
|
||||
'video_full_resolution': session.get('video_full_resolution', ''),
|
||||
'aspect_ratio': session.get('aspect_ratio', ''),
|
||||
'audio_codec': session.get('audio_codec', ''),
|
||||
'audio_bitrate': session.get('audio_bitrate', ''),
|
||||
@@ -106,6 +108,8 @@ class ActivityProcessor(object):
|
||||
'stream_video_width': session.get('stream_video_width', ''),
|
||||
'stream_video_height': session.get('stream_video_height', ''),
|
||||
'stream_video_framerate': session.get('stream_video_framerate', ''),
|
||||
'stream_video_scan_type': session.get('stream_video_scan_type', ''),
|
||||
'stream_video_full_resolution': session.get('stream_video_full_resolution', ''),
|
||||
'stream_audio_decision': session.get('stream_audio_decision', ''),
|
||||
'stream_audio_codec': session.get('stream_audio_codec', ''),
|
||||
'stream_audio_bitrate': session.get('stream_audio_bitrate', ''),
|
||||
@@ -347,6 +351,8 @@ class ActivityProcessor(object):
|
||||
'video_height': session['video_height'],
|
||||
'video_resolution': session['video_resolution'],
|
||||
'video_framerate': session['video_framerate'],
|
||||
'video_scan_type': session['video_scan_type'],
|
||||
'video_full_resolution': session['video_full_resolution'],
|
||||
'aspect_ratio': session['aspect_ratio'],
|
||||
'audio_codec': session['audio_codec'],
|
||||
'audio_bitrate': session['audio_bitrate'],
|
||||
@@ -379,6 +385,8 @@ class ActivityProcessor(object):
|
||||
'stream_video_width': session['stream_video_width'],
|
||||
'stream_video_resolution': session['stream_video_resolution'],
|
||||
'stream_video_framerate': session['stream_video_framerate'],
|
||||
'stream_video_scan_type': session['stream_video_scan_type'],
|
||||
'stream_video_full_resolution': session['stream_video_full_resolution'],
|
||||
'stream_audio_decision': session['stream_audio_decision'],
|
||||
'stream_audio_codec': session['stream_audio_codec'],
|
||||
'stream_audio_bitrate': session['stream_audio_bitrate'],
|
||||
|
@@ -875,12 +875,12 @@ class DataFactory(object):
|
||||
user_cond = 'AND %s.user_id = %s ' % (table, session.get_session_user_id())
|
||||
|
||||
if row_id:
|
||||
query = 'SELECT bitrate, video_resolution, ' \
|
||||
query = 'SELECT bitrate, video_full_resolution, ' \
|
||||
'optimized_version, optimized_version_profile, optimized_version_title, ' \
|
||||
'synced_version, synced_version_profile, ' \
|
||||
'container, video_codec, video_bitrate, video_width, video_height, video_framerate, aspect_ratio, ' \
|
||||
'audio_codec, audio_bitrate, audio_channels, subtitle_codec, ' \
|
||||
'stream_bitrate, stream_video_resolution, quality_profile, stream_container_decision, stream_container, ' \
|
||||
'stream_bitrate, stream_video_full_resolution, quality_profile, stream_container_decision, stream_container, ' \
|
||||
'stream_video_decision, stream_video_codec, stream_video_bitrate, stream_video_width, stream_video_height, ' \
|
||||
'stream_video_framerate, ' \
|
||||
'stream_audio_decision, stream_audio_codec, stream_audio_bitrate, stream_audio_channels, ' \
|
||||
@@ -896,12 +896,12 @@ class DataFactory(object):
|
||||
'WHERE session_history_media_info.id = ? %s' % user_cond
|
||||
result = monitor_db.select(query, args=[row_id])
|
||||
elif session_key:
|
||||
query = 'SELECT bitrate, video_resolution, ' \
|
||||
query = 'SELECT bitrate, video_full_resolution, ' \
|
||||
'optimized_version, optimized_version_profile, optimized_version_title, ' \
|
||||
'synced_version, synced_version_profile, ' \
|
||||
'container, video_codec, video_bitrate, video_width, video_height, video_framerate, aspect_ratio, ' \
|
||||
'audio_codec, audio_bitrate, audio_channels, subtitle_codec, ' \
|
||||
'stream_bitrate, stream_video_resolution, quality_profile, stream_container_decision, stream_container, ' \
|
||||
'stream_bitrate, stream_video_full_resolution, quality_profile, stream_container_decision, stream_container, ' \
|
||||
'stream_video_decision, stream_video_codec, stream_video_bitrate, stream_video_width, stream_video_height, ' \
|
||||
'stream_video_framerate, ' \
|
||||
'stream_audio_decision, stream_audio_codec, stream_audio_bitrate, stream_audio_channels, ' \
|
||||
@@ -924,7 +924,7 @@ class DataFactory(object):
|
||||
|
||||
# For backwards compatibility. Pick one new Tautulli key to check and override with old values.
|
||||
if not item['stream_container']:
|
||||
item['stream_video_resolution'] = item['video_resolution']
|
||||
item['stream_video_full_resolution'] = item['video_full_resolution']
|
||||
item['stream_container'] = item['transcode_container'] or item['container']
|
||||
item['stream_video_decision'] = item['video_decision']
|
||||
item['stream_video_codec'] = item['transcode_video_codec'] or item['video_codec']
|
||||
@@ -938,7 +938,7 @@ class DataFactory(object):
|
||||
pre_tautulli = 1
|
||||
|
||||
stream_output = {'bitrate': item['bitrate'],
|
||||
'video_resolution': item['video_resolution'],
|
||||
'video_full_resolution': item['video_full_resolution'],
|
||||
'optimized_version': item['optimized_version'],
|
||||
'optimized_version_profile': item['optimized_version_profile'],
|
||||
'optimized_version_title': item['optimized_version_title'],
|
||||
@@ -956,7 +956,7 @@ class DataFactory(object):
|
||||
'audio_channels': item['audio_channels'],
|
||||
'subtitle_codec': item['subtitle_codec'],
|
||||
'stream_bitrate': item['stream_bitrate'],
|
||||
'stream_video_resolution': item['stream_video_resolution'],
|
||||
'stream_video_full_resolution': item['stream_video_full_resolution'],
|
||||
'quality_profile': item['quality_profile'],
|
||||
'stream_container_decision': item['stream_container_decision'],
|
||||
'stream_container': item['stream_container'],
|
||||
|
@@ -698,7 +698,7 @@ class Graphs(object):
|
||||
|
||||
try:
|
||||
if y_axis == 'plays':
|
||||
query = 'SELECT UPPER(session_history_media_info.video_resolution) AS resolution, ' \
|
||||
query = 'SELECT session_history_media_info.video_full_resolution AS resolution, ' \
|
||||
'SUM(CASE WHEN session_history_media_info.transcode_decision = "direct play" ' \
|
||||
'THEN 1 ELSE 0 END) AS dp_count, ' \
|
||||
'SUM(CASE WHEN session_history_media_info.transcode_decision = "copy" ' \
|
||||
@@ -717,7 +717,7 @@ class Graphs(object):
|
||||
|
||||
result = monitor_db.select(query)
|
||||
else:
|
||||
query = 'SELECT UPPER(session_history_media_info.video_resolution) AS resolution,' \
|
||||
query = 'SELECT session_history_media_info.video_full_resolution AS resolution,' \
|
||||
'SUM(CASE WHEN session_history_media_info.transcode_decision = "direct play" ' \
|
||||
'AND session_history.stopped > 0 THEN (session_history.stopped - session_history.started) ' \
|
||||
' - (CASE WHEN paused_counter IS NULL THEN 0 ELSE paused_counter END) ELSE 0 END) AS dp_count, ' \
|
||||
@@ -749,10 +749,6 @@ class Graphs(object):
|
||||
series_3 = []
|
||||
|
||||
for item in result:
|
||||
if item['resolution'] not in ('4k', 'unknown'):
|
||||
item['resolution'] = item['resolution'].upper()
|
||||
if item['resolution'].isdigit():
|
||||
item['resolution'] += 'p'
|
||||
categories.append(item['resolution'])
|
||||
series_1.append(item['dp_count'])
|
||||
series_2.append(item['ds_count'])
|
||||
@@ -789,7 +785,7 @@ class Graphs(object):
|
||||
try:
|
||||
if y_axis == 'plays':
|
||||
query = 'SELECT ' \
|
||||
'(CASE WHEN session_history_media_info.stream_video_resolution IS NULL THEN ' \
|
||||
'(CASE WHEN session_history_media_info.stream_video_full_resolution IS NULL THEN ' \
|
||||
'(CASE WHEN session_history_media_info.video_decision = "transcode" THEN ' \
|
||||
'(CASE ' \
|
||||
'WHEN session_history_media_info.transcode_height <= 360 THEN "SD" ' \
|
||||
@@ -799,8 +795,8 @@ class Graphs(object):
|
||||
'WHEN session_history_media_info.transcode_height <= 1080 THEN "1080" ' \
|
||||
'WHEN session_history_media_info.transcode_height <= 1440 THEN "QHD" ' \
|
||||
'WHEN session_history_media_info.transcode_height <= 2160 THEN "4k" ' \
|
||||
'ELSE "unknown" END) ELSE UPPER(session_history_media_info.video_resolution) END) ' \
|
||||
'ELSE UPPER(session_history_media_info.stream_video_resolution) END) AS resolution, ' \
|
||||
'ELSE "unknown" END) ELSE session_history_media_info.video_full_resolution END) ' \
|
||||
'ELSE session_history_media_info.stream_video_full_resolution END) AS resolution, ' \
|
||||
'SUM(CASE WHEN session_history_media_info.transcode_decision = "direct play" ' \
|
||||
'THEN 1 ELSE 0 END) AS dp_count, ' \
|
||||
'SUM(CASE WHEN session_history_media_info.transcode_decision = "copy" ' \
|
||||
@@ -820,7 +816,7 @@ class Graphs(object):
|
||||
result = monitor_db.select(query)
|
||||
else:
|
||||
query = 'SELECT ' \
|
||||
'(CASE WHEN session_history_media_info.stream_video_resolution IS NULL THEN ' \
|
||||
'(CASE WHEN session_history_media_info.stream_video_full_resolution IS NULL THEN ' \
|
||||
'(CASE WHEN session_history_media_info.video_decision = "transcode" THEN ' \
|
||||
'(CASE ' \
|
||||
'WHEN session_history_media_info.transcode_height <= 360 THEN "SD" ' \
|
||||
@@ -830,8 +826,8 @@ class Graphs(object):
|
||||
'WHEN session_history_media_info.transcode_height <= 1080 THEN "1080" ' \
|
||||
'WHEN session_history_media_info.transcode_height <= 1440 THEN "QHD" ' \
|
||||
'WHEN session_history_media_info.transcode_height <= 2160 THEN "4k" ' \
|
||||
'ELSE "unknown" END) ELSE UPPER(session_history_media_info.video_resolution) END) ' \
|
||||
'ELSE UPPER(session_history_media_info.stream_video_resolution) END) AS resolution, ' \
|
||||
'ELSE "unknown" END) ELSE session_history_media_info.video_full_resolution END) ' \
|
||||
'ELSE session_history_media_info.stream_video_full_resolution END) AS resolution, ' \
|
||||
'SUM(CASE WHEN session_history_media_info.transcode_decision = "direct play" ' \
|
||||
'AND session_history.stopped > 0 THEN (session_history.stopped - session_history.started) ' \
|
||||
' - (CASE WHEN paused_counter IS NULL THEN 0 ELSE paused_counter END) ELSE 0 END) AS dp_count, ' \
|
||||
@@ -863,10 +859,6 @@ class Graphs(object):
|
||||
series_3 = []
|
||||
|
||||
for item in result:
|
||||
if item['resolution'] not in ('4k', 'unknown'):
|
||||
item['resolution'] = item['resolution'].upper()
|
||||
if item['resolution'].isdigit():
|
||||
item['resolution'] += 'p'
|
||||
categories.append(item['resolution'])
|
||||
series_1.append(item['dp_count'])
|
||||
series_2.append(item['ds_count'])
|
||||
|
@@ -710,6 +710,8 @@ class PmsConnect(object):
|
||||
'updated_at': helpers.get_xml_attr(metadata_main, 'updatedAt'),
|
||||
'last_viewed_at': helpers.get_xml_attr(metadata_main, 'lastViewedAt'),
|
||||
'guid': helpers.get_xml_attr(metadata_main, 'guid'),
|
||||
'parent_guid': helpers.get_xml_attr(metadata_main, 'parentGuid'),
|
||||
'grandparent_guid': helpers.get_xml_attr(metadata_main, 'grandparentGuid'),
|
||||
'directors': directors,
|
||||
'writers': writers,
|
||||
'actors': actors,
|
||||
@@ -760,6 +762,8 @@ class PmsConnect(object):
|
||||
'updated_at': helpers.get_xml_attr(metadata_main, 'updatedAt'),
|
||||
'last_viewed_at': helpers.get_xml_attr(metadata_main, 'lastViewedAt'),
|
||||
'guid': helpers.get_xml_attr(metadata_main, 'guid'),
|
||||
'parent_guid': helpers.get_xml_attr(metadata_main, 'parentGuid'),
|
||||
'grandparent_guid': helpers.get_xml_attr(metadata_main, 'grandparentGuid'),
|
||||
'directors': directors,
|
||||
'writers': writers,
|
||||
'actors': actors,
|
||||
@@ -807,6 +811,8 @@ class PmsConnect(object):
|
||||
'updated_at': helpers.get_xml_attr(metadata_main, 'updatedAt'),
|
||||
'last_viewed_at': helpers.get_xml_attr(metadata_main, 'lastViewedAt'),
|
||||
'guid': helpers.get_xml_attr(metadata_main, 'guid'),
|
||||
'parent_guid': helpers.get_xml_attr(metadata_main, 'parentGuid'),
|
||||
'grandparent_guid': helpers.get_xml_attr(metadata_main, 'grandparentGuid'),
|
||||
'directors': show_details['directors'],
|
||||
'writers': show_details['writers'],
|
||||
'actors': show_details['actors'],
|
||||
@@ -871,6 +877,8 @@ class PmsConnect(object):
|
||||
'updated_at': helpers.get_xml_attr(metadata_main, 'updatedAt'),
|
||||
'last_viewed_at': helpers.get_xml_attr(metadata_main, 'lastViewedAt'),
|
||||
'guid': helpers.get_xml_attr(metadata_main, 'guid'),
|
||||
'parent_guid': helpers.get_xml_attr(metadata_main, 'parentGuid'),
|
||||
'grandparent_guid': helpers.get_xml_attr(metadata_main, 'grandparentGuid'),
|
||||
'directors': directors,
|
||||
'writers': writers,
|
||||
'actors': show_details['actors'],
|
||||
@@ -917,6 +925,8 @@ class PmsConnect(object):
|
||||
'updated_at': helpers.get_xml_attr(metadata_main, 'updatedAt'),
|
||||
'last_viewed_at': helpers.get_xml_attr(metadata_main, 'lastViewedAt'),
|
||||
'guid': helpers.get_xml_attr(metadata_main, 'guid'),
|
||||
'parent_guid': helpers.get_xml_attr(metadata_main, 'parentGuid'),
|
||||
'grandparent_guid': helpers.get_xml_attr(metadata_main, 'grandparentGuid'),
|
||||
'directors': directors,
|
||||
'writers': writers,
|
||||
'actors': actors,
|
||||
@@ -964,6 +974,8 @@ class PmsConnect(object):
|
||||
'updated_at': helpers.get_xml_attr(metadata_main, 'updatedAt'),
|
||||
'last_viewed_at': helpers.get_xml_attr(metadata_main, 'lastViewedAt'),
|
||||
'guid': helpers.get_xml_attr(metadata_main, 'guid'),
|
||||
'parent_guid': helpers.get_xml_attr(metadata_main, 'parentGuid'),
|
||||
'grandparent_guid': helpers.get_xml_attr(metadata_main, 'grandparentGuid'),
|
||||
'directors': directors,
|
||||
'writers': writers,
|
||||
'actors': actors,
|
||||
@@ -1014,6 +1026,8 @@ class PmsConnect(object):
|
||||
'updated_at': helpers.get_xml_attr(metadata_main, 'updatedAt'),
|
||||
'last_viewed_at': helpers.get_xml_attr(metadata_main, 'lastViewedAt'),
|
||||
'guid': helpers.get_xml_attr(metadata_main, 'guid'),
|
||||
'parent_guid': helpers.get_xml_attr(metadata_main, 'parentGuid'),
|
||||
'grandparent_guid': helpers.get_xml_attr(metadata_main, 'grandparentGuid'),
|
||||
'directors': directors,
|
||||
'writers': writers,
|
||||
'actors': actors,
|
||||
@@ -1060,6 +1074,8 @@ class PmsConnect(object):
|
||||
'updated_at': helpers.get_xml_attr(metadata_main, 'updatedAt'),
|
||||
'last_viewed_at': helpers.get_xml_attr(metadata_main, 'lastViewedAt'),
|
||||
'guid': helpers.get_xml_attr(metadata_main, 'guid'),
|
||||
'parent_guid': helpers.get_xml_attr(metadata_main, 'parentGuid'),
|
||||
'grandparent_guid': helpers.get_xml_attr(metadata_main, 'grandparentGuid'),
|
||||
'directors': directors,
|
||||
'writers': writers,
|
||||
'actors': actors,
|
||||
@@ -1107,6 +1123,8 @@ class PmsConnect(object):
|
||||
'updated_at': helpers.get_xml_attr(metadata_main, 'updatedAt'),
|
||||
'last_viewed_at': helpers.get_xml_attr(metadata_main, 'lastViewedAt'),
|
||||
'guid': helpers.get_xml_attr(metadata_main, 'guid'),
|
||||
'parent_guid': helpers.get_xml_attr(metadata_main, 'parentGuid'),
|
||||
'grandparent_guid': helpers.get_xml_attr(metadata_main, 'grandparentGuid'),
|
||||
'directors': directors,
|
||||
'writers': writers,
|
||||
'actors': actors,
|
||||
@@ -1156,6 +1174,8 @@ class PmsConnect(object):
|
||||
'updated_at': helpers.get_xml_attr(metadata_main, 'updatedAt'),
|
||||
'last_viewed_at': helpers.get_xml_attr(metadata_main, 'lastViewedAt'),
|
||||
'guid': helpers.get_xml_attr(metadata_main, 'guid'),
|
||||
'parent_guid': helpers.get_xml_attr(metadata_main, 'parentGuid'),
|
||||
'grandparent_guid': helpers.get_xml_attr(metadata_main, 'grandparentGuid'),
|
||||
'child_count': helpers.get_xml_attr(metadata_main, 'childCount'),
|
||||
'directors': directors,
|
||||
'writers': writers,
|
||||
@@ -1202,6 +1222,8 @@ class PmsConnect(object):
|
||||
'updated_at': helpers.get_xml_attr(metadata_main, 'updatedAt'),
|
||||
'last_viewed_at': helpers.get_xml_attr(metadata_main, 'lastViewedAt'),
|
||||
'guid': helpers.get_xml_attr(metadata_main, 'guid'),
|
||||
'parent_guid': helpers.get_xml_attr(metadata_main, 'parentGuid'),
|
||||
'grandparent_guid': helpers.get_xml_attr(metadata_main, 'grandparentGuid'),
|
||||
'directors': directors,
|
||||
'writers': writers,
|
||||
'actors': actors,
|
||||
@@ -1220,6 +1242,7 @@ class PmsConnect(object):
|
||||
medias = []
|
||||
media_items = metadata_main.getElementsByTagName('Media')
|
||||
for media in media_items:
|
||||
video_full_resolution_scan_type = None
|
||||
|
||||
parts = []
|
||||
part_items = media.getElementsByTagName('Part')
|
||||
@@ -1229,6 +1252,10 @@ class PmsConnect(object):
|
||||
stream_items = part.getElementsByTagName('Stream')
|
||||
for stream in stream_items:
|
||||
if helpers.get_xml_attr(stream, 'streamType') == '1':
|
||||
video_scan_type = helpers.get_xml_attr(stream, 'scanType')
|
||||
if video_full_resolution_scan_type is None:
|
||||
video_full_resolution_scan_type = video_scan_type
|
||||
|
||||
streams.append({'id': helpers.get_xml_attr(stream, 'id'),
|
||||
'type': helpers.get_xml_attr(stream, 'streamType'),
|
||||
'video_codec': helpers.get_xml_attr(stream, 'codec'),
|
||||
@@ -1282,6 +1309,13 @@ class PmsConnect(object):
|
||||
'selected': int(helpers.get_xml_attr(part, 'selected') == '1')
|
||||
})
|
||||
|
||||
video_resolution = helpers.get_xml_attr(media, 'videoResolution').lower()
|
||||
video_full_resolution = ''
|
||||
if video_full_resolution_scan_type is not None:
|
||||
video_full_resolution = common.VIDEO_RESOLUTION_OVERRIDES.get(
|
||||
video_resolution, video_resolution + (video_full_resolution_scan_type[:1] or 'p')
|
||||
)
|
||||
|
||||
audio_channels = helpers.get_xml_attr(media, 'audioChannels')
|
||||
|
||||
medias.append({'id': helpers.get_xml_attr(media, 'id'),
|
||||
@@ -1291,7 +1325,8 @@ class PmsConnect(object):
|
||||
'width': helpers.get_xml_attr(media, 'width'),
|
||||
'aspect_ratio': helpers.get_xml_attr(media, 'aspectRatio'),
|
||||
'video_codec': helpers.get_xml_attr(media, 'videoCodec'),
|
||||
'video_resolution': helpers.get_xml_attr(media, 'videoResolution').lower(),
|
||||
'video_resolution': video_resolution,
|
||||
'video_full_resolution': video_full_resolution,
|
||||
'video_framerate': helpers.get_xml_attr(media, 'videoFrameRate'),
|
||||
'video_profile': helpers.get_xml_attr(media, 'videoProfile'),
|
||||
'audio_codec': helpers.get_xml_attr(media, 'audioCodec'),
|
||||
@@ -1301,7 +1336,9 @@ class PmsConnect(object):
|
||||
'optimized_version': int(helpers.get_xml_attr(media, 'proxyType') == '42'),
|
||||
'parts': parts
|
||||
})
|
||||
|
||||
|
||||
video_full_resolution = helpers.get_xml_attr(media, 'videoResolution').lower()
|
||||
|
||||
metadata['media_info'] = medias
|
||||
|
||||
if metadata:
|
||||
@@ -1926,14 +1963,11 @@ class PmsConnect(object):
|
||||
if transcode_details['transcode_video_codec'] == '*':
|
||||
transcode_details['transcode_video_codec'] = source_video_details['video_codec']
|
||||
|
||||
# Set the full resolution by combining video_resolution and video_scan_type
|
||||
source_media_details['video_full_resolution'] = plexpy.common.VIDEO_RESOLUTION_OVERRIDES.get(
|
||||
source_media_details['video_resolution'],
|
||||
source_media_details['video_resolution'] + (source_video_details['video_scan_type'][:1] or 'p'))
|
||||
# Set the full resolution by combining stream_video_resolution and stream_video_scan_type
|
||||
stream_details['stream_video_full_resolution'] = plexpy.common.VIDEO_RESOLUTION_OVERRIDES.get(
|
||||
stream_details['stream_video_resolution'],
|
||||
stream_details['stream_video_resolution'] + (video_details['stream_video_scan_type'][:1] or 'p'))
|
||||
if media_type in ('movie', 'episode', 'clip'):
|
||||
# Set the full resolution by combining stream_video_resolution and stream_video_scan_type
|
||||
stream_details['stream_video_full_resolution'] = common.VIDEO_RESOLUTION_OVERRIDES.get(
|
||||
stream_details['stream_video_resolution'],
|
||||
stream_details['stream_video_resolution'] + (video_details['stream_video_scan_type'][:1] or 'p'))
|
||||
|
||||
# Get the quality profile
|
||||
if media_type in ('movie', 'episode', 'clip') and 'stream_bitrate' in stream_details:
|
||||
|
@@ -1,2 +1,2 @@
|
||||
PLEXPY_BRANCH = "beta"
|
||||
PLEXPY_RELEASE_VERSION = "v2.1.35-beta"
|
||||
PLEXPY_RELEASE_VERSION = "v2.1.36-beta"
|
||||
|
@@ -4559,6 +4559,7 @@ class WebInterface(object):
|
||||
"Drama",
|
||||
"Fantasy"
|
||||
],
|
||||
"grandparent_guid": "com.plexapp.agents.thetvdb://121361?lang=en",
|
||||
"grandparent_rating_key": "1219",
|
||||
"grandparent_thumb": "/library/metadata/1219/thumb/1462175063",
|
||||
"grandparent_title": "Game of Thrones",
|
||||
@@ -4599,6 +4600,7 @@ class WebInterface(object):
|
||||
"video_language_code": "",
|
||||
"video_profile": "high",
|
||||
"video_ref_frames": "4",
|
||||
"video_scan_type": "progressive",
|
||||
"video_width": "1920",
|
||||
"selected": 0
|
||||
},
|
||||
@@ -4633,6 +4635,7 @@ class WebInterface(object):
|
||||
],
|
||||
"video_codec": "h264",
|
||||
"video_framerate": "24p",
|
||||
"video_full_resolution": "1080p",
|
||||
"video_profile": "high",
|
||||
"video_resolution": "1080",
|
||||
"width": "1920"
|
||||
@@ -4641,6 +4644,7 @@ class WebInterface(object):
|
||||
"media_type": "episode",
|
||||
"original_title": "",
|
||||
"originally_available_at": "2016-04-24",
|
||||
"parent_guid": "com.plexapp.agents.thetvdb://121361/6?lang=en",
|
||||
"parent_media_index": "6",
|
||||
"parent_rating_key": "153036",
|
||||
"parent_thumb": "/library/metadata/153036/thumb/1462175062",
|
||||
@@ -4951,6 +4955,7 @@ class WebInterface(object):
|
||||
"Drama",
|
||||
"Fantasy"
|
||||
],
|
||||
"grandparent_guid": "com.plexapp.agents.thetvdb://121361?lang=en",
|
||||
"grandparent_rating_key": "1219",
|
||||
"grandparent_thumb": "/library/metadata/1219/thumb/1503306930",
|
||||
"grandparent_title": "Game of Thrones",
|
||||
@@ -4978,6 +4983,7 @@ class WebInterface(object):
|
||||
"optimized_version_title": "",
|
||||
"originally_available_at": "2016-04-24",
|
||||
"original_title": "",
|
||||
"parent_guid": "com.plexapp.agents.thetvdb://121361/6?lang=en",
|
||||
"parent_media_index": "6",
|
||||
"parent_rating_key": "153036",
|
||||
"parent_thumb": "/library/metadata/153036/thumb/1503889210",
|
||||
|
Reference in New Issue
Block a user