move show description, fix poster

This commit is contained in:
j 2024-06-02 11:34:15 +01:00
parent a6b5d8d40e
commit 2ad6e1deda
2 changed files with 82 additions and 77 deletions

View file

@ -17,7 +17,7 @@ def render_poster(data, poster):
title = ox.decode_html(data.get('title', ''))
director = ox.decode_html(', '.join(data.get('show', [])))
year = str(data.get('date', ''))
year = str(data.get('date', '')).split(" ")[0]
series = data.get('isSeries', False)
oxdb_id = data['oxdbId']
imdb_id = data['id']
@ -33,7 +33,7 @@ def render_poster(data, poster):
}
]
},
"keys": ["id", "frame"]
"keys": ["id", "image"]
})["data"]["items"]
if r:
did = r[0]["image"]

View file

@ -234,81 +234,6 @@ pandora.ui.infoView = function(data, isMixed) {
pandora.createLinks($info);
}
// Show description -----------------------------------------------------
if (!isMultiple) {
;['show'].forEach(key => {
var $box = $('<div>').appendTo($data);
(data[key] ? pandora.api.findEntities : Ox.noop)({
query: {
conditions: [{
key: 'type', operator: '==', value: Ox.decodeHTMLEntities(key)
}, {
key: 'name', operator: '==', value: Ox.decodeHTMLEntities(data[key][0] || '')
}],
operator: '&'
},
keys: ['id', 'name', 'description', 'image']
}, function(result) {
if (data[key] && ((result && result.data.items.length == 1) || canEdit)) {
var entity = {}
if (result && result.data.items.length) {
entity = result.data.items[0]
}
$('<div>')
.html(Ox._('About {0}:', [data[key]]))
.css({
'padding-top': '4px',
'font-weight': 'bold'
})
.appendTo($box);
$('<div>')
.addClass("InlineImages")
.append(
Ox.EditableContent({
clickLink: pandora.clickLink,
editable: false,
placeholder: formatLight(Ox._('No {0} Description', [Ox._(Ox.toTitleCase(key))])),
tooltip: canEdit ? pandora.getEditTooltip() : '',
type: 'textarea',
value: entity.description || ''
})
.css(css)
.css({
'text-align': ''
})
.bindEvent({
doubleclick: function(event) {
if (!canEdit) {
return
}
if (entity.id) {
var set = {}
set['entitiesType'] = key
set['entitiesSelection.' + key] = [entity.id];
pandora.UI.set(set);
pandora.$ui.entitiesDialog = pandora.ui.entitiesDialog().open();
} else {
pandora.api.addEntity({
type: key,
name: data[key]
}, function(result) {
var set = {}
set['entitiesType'] = key
set['entitiesSelection.' + key] = [result.data.id];
pandora.UI.set(set);
pandora.$ui.entitiesDialog = pandora.ui.entitiesDialog().open();
})
}
}
})
).css({
margin: '12px 0',
})
.appendTo($box);
}
})
});
}
// Title -------------------------------------------------------------------
@ -377,6 +302,86 @@ pandora.ui.infoView = function(data, isMixed) {
.appendTo($text);
}
// Show description -----------------------------------------------------
if (!isMultiple) {
;['show'].forEach(key => {
var $box = $('<div>')
.css({
marginTop: '12px',
})
.appendTo($text);
(data[key] ? pandora.api.findEntities : Ox.noop)({
query: {
conditions: [{
key: 'type', operator: '==', value: Ox.decodeHTMLEntities(key)
}, {
key: 'name', operator: '==', value: Ox.decodeHTMLEntities(data[key][0] || '')
}],
operator: '&'
},
keys: ['id', 'name', 'description', 'image']
}, function(result) {
if (data[key] && ((result && result.data.items.length == 1) || canEdit)) {
var entity = {}
if (result && result.data.items.length) {
entity = result.data.items[0]
}
$('<div>')
.html(Ox._('About {0}:', [data[key]]))
.css({
'padding-top': '4px',
'font-weight': 'bold'
})
.appendTo($box);
$('<div>')
.addClass("InlineImages")
.append(
Ox.EditableContent({
clickLink: pandora.clickLink,
editable: false,
placeholder: formatLight(Ox._('No {0} Description', [Ox._(Ox.toTitleCase(key))])),
tooltip: canEdit ? pandora.getEditTooltip() : '',
type: 'textarea',
value: entity.description || ''
})
.css(css)
.css({
'text-align': ''
})
.bindEvent({
doubleclick: function(event) {
if (!canEdit) {
return
}
if (entity.id) {
var set = {}
set['entitiesType'] = key
set['entitiesSelection.' + key] = [entity.id];
pandora.UI.set(set);
pandora.$ui.entitiesDialog = pandora.ui.entitiesDialog().open();
} else {
pandora.api.addEntity({
type: key,
name: data[key]
}, function(result) {
var set = {}
set['entitiesType'] = key
set['entitiesSelection.' + key] = [result.data.id];
pandora.UI.set(set);
pandora.$ui.entitiesDialog = pandora.ui.entitiesDialog().open();
})
}
}
})
).css({
margin: '12px 0',
})
.appendTo($text);
}
})
});
}
// Duration, Aspect Ratio --------------------------------------------------
if (!isMultiple) {