mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-07 13:41:15 -07:00
Add helper function for info page
This commit is contained in:
parent
e4b6d61098
commit
fe0557dcc1
2 changed files with 35 additions and 0 deletions
|
@ -735,3 +735,21 @@ function pms_image_proxy(img, rating_key, width, height, opacity, background, bl
|
||||||
|
|
||||||
return 'pms_image_proxy?' + $.param(img_info);
|
return 'pms_image_proxy?' + $.param(img_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function info_page(rating_key, guid, history, live) {
|
||||||
|
var info = {};
|
||||||
|
|
||||||
|
if (live && history) {
|
||||||
|
info.guid = guid;
|
||||||
|
} else {
|
||||||
|
info.rating_key = rating_key;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (history != null) { info.source = 'history'; }
|
||||||
|
|
||||||
|
if (info.rating_key || info.guid) {
|
||||||
|
return 'info?' + $.param(info);
|
||||||
|
} else {
|
||||||
|
return '#';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1289,3 +1289,20 @@ def pms_image_proxy(img=None, rating_key=None, width=None, height=None,
|
||||||
img_info['clip'] = 'true'
|
img_info['clip'] = 'true'
|
||||||
|
|
||||||
return 'pms_image_proxy?' + urllib.urlencode(img_info)
|
return 'pms_image_proxy?' + urllib.urlencode(img_info)
|
||||||
|
|
||||||
|
|
||||||
|
def info_page(rating_key=None, guid=None, history=None, live=None):
|
||||||
|
info = {}
|
||||||
|
|
||||||
|
if live and history:
|
||||||
|
info['guid'] = guid
|
||||||
|
else:
|
||||||
|
info['rating_key'] = rating_key
|
||||||
|
|
||||||
|
if history:
|
||||||
|
info['source'] = 'history'
|
||||||
|
|
||||||
|
if info.get('rating_key') or info.get('guid'):
|
||||||
|
return 'info?' + urllib.urlencode(info)
|
||||||
|
else:
|
||||||
|
return '#'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue