mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Add support for displaying more sub info
This commit is contained in:
parent
cb22736d02
commit
8ff6bc1487
2 changed files with 40 additions and 6 deletions
|
@ -194,7 +194,8 @@ function renderSearchResults(context, results) {
|
|||
|
||||
html += '<span class="listItemIcon material-icons closed_caption" aria-hidden="true"></span>';
|
||||
|
||||
const bodyClass = result.Comment || result.IsHashMatch ? 'three-line' : 'two-line';
|
||||
const hasAnyFlags = result.IsHashMatch || result.AiTranslated || result.MachineTranslated || result.Forced || result.HearingImpaired;
|
||||
const bodyClass = result.Comment || hasAnyFlags ? 'three-line' : 'two-line';
|
||||
|
||||
html += '<div class="listItemBody ' + bodyClass + '">';
|
||||
|
||||
|
@ -206,16 +207,45 @@ function renderSearchResults(context, results) {
|
|||
}
|
||||
|
||||
if (result.DownloadCount != null) {
|
||||
html += '<span>' + globalize.translate('DownloadsValue', result.DownloadCount) + '</span>';
|
||||
html += '<span style="margin-right:1em;">' + globalize.translate('DownloadsValue', result.DownloadCount) + '</span>';
|
||||
}
|
||||
|
||||
if (result.FrameRate) {
|
||||
html += '<span>' + globalize.translate('Framerate') + ': ' + result.FrameRate + '</span>';
|
||||
}
|
||||
|
||||
html += '</div>';
|
||||
|
||||
if (result.Comment) {
|
||||
html += '<div class="secondary listItemBodyText">' + escapeHtml(result.Comment) + '</div>';
|
||||
html += '<div class="secondary listItemBodyText" style="white-space:pre-line;">' + escapeHtml(result.Comment) + '</div>';
|
||||
}
|
||||
|
||||
if (result.IsHashMatch) {
|
||||
html += '<div class="secondary listItemBodyText"><div class="inline-flex align-items-center justify-content-center" style="background:#3388cc;color:#fff;padding: .3em 1em;border-radius:1000em;">' + globalize.translate('PerfectMatch') + '</div></div>';
|
||||
if (hasAnyFlags) {
|
||||
html += '<div class="secondary listItemBodyText">';
|
||||
|
||||
const spanOpen = '<span class="inline-flex align-items-center justify-content-center" style="background:#3388cc;color:#fff;padding: .3em 1em;border-radius:1000em;margin-right:0.25em;">';
|
||||
|
||||
if (result.IsHashMatch) {
|
||||
html += spanOpen + globalize.translate('PerfectMatch') + '</span>';
|
||||
}
|
||||
|
||||
if (result.AiTranslated) {
|
||||
html += spanOpen + globalize.translate('AiTranslated') + '</span>';
|
||||
}
|
||||
|
||||
if (result.MachineTranslated) {
|
||||
html += spanOpen + globalize.translate('MachineTranslated') + '</span>';
|
||||
}
|
||||
|
||||
if (result.Forced) {
|
||||
html += spanOpen + globalize.translate('ForeignPartsOnly') + '</span>';
|
||||
}
|
||||
|
||||
if (result.HearingImpaired) {
|
||||
html += spanOpen.replace('margin-right:0.25em;', '') + globalize.translate('HearingImpairedShort') + '</span>';
|
||||
}
|
||||
|
||||
html += '</div>';
|
||||
}
|
||||
|
||||
html += '</div>';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue