Merge pull request #3323 from thornbill/fix-img-paths

Fix image urls
This commit is contained in:
Bill Thornton 2022-01-13 12:52:00 -05:00 committed by GitHub
commit 80891c2364
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 10 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

View File

@ -3,6 +3,8 @@ import { playbackManager } from '../playback/playbackmanager';
import { Events } from 'jellyfin-apiclient'; import { Events } from 'jellyfin-apiclient';
import globalize from '../../scripts/globalize'; import globalize from '../../scripts/globalize';
import NotificationIcon from './notificationicon.png';
function onOneDocumentClick() { function onOneDocumentClick() {
document.removeEventListener('click', onOneDocumentClick); document.removeEventListener('click', onOneDocumentClick);
document.removeEventListener('keydown', onOneDocumentClick); document.removeEventListener('keydown', onOneDocumentClick);
@ -71,8 +73,8 @@ function showNotification(options, timeoutMs, apiClient) {
options.data = options.data || {}; options.data = options.data || {};
options.data.serverId = apiClient.serverInfo().Id; options.data.serverId = apiClient.serverInfo().Id;
options.icon = options.icon || getIconUrl(); options.icon = options.icon || NotificationIcon;
options.badge = options.badge || getIconUrl('badge.png'); options.badge = options.badge || NotificationIcon;
resetRegistration(); resetRegistration();
@ -148,11 +150,6 @@ function onLibraryChanged(data, apiClient) {
}); });
} }
function getIconUrl(name) {
name = name || 'notificationicon.png';
return './components/notifications/' + name;
}
function showPackageInstallNotification(apiClient, installation, status) { function showPackageInstallNotification(apiClient, installation, status) {
apiClient.getCurrentUser().then(function (user) { apiClient.getCurrentUser().then(function (user) {
if (!user.Policy.IsAdministrator) { if (!user.Policy.IsAdministrator) {
@ -180,7 +177,7 @@ function showPackageInstallNotification(apiClient, installation, status) {
{ {
action: 'cancel-install', action: 'cancel-install',
title: globalize.translate('ButtonCancel'), title: globalize.translate('ButtonCancel'),
icon: getIconUrl() icon: NotificationIcon
} }
]; ];
@ -249,7 +246,7 @@ Events.on(serverNotifications, 'RestartRequired', function (e, apiClient) {
{ {
action: 'restart', action: 'restart',
title: globalize.translate('Restart'), title: globalize.translate('Restart'),
icon: getIconUrl() icon: NotificationIcon
} }
]; ];

View File

@ -20,6 +20,8 @@ import ServerConnections from '../ServerConnections';
import { playbackManager } from '../playback/playbackmanager'; import { playbackManager } from '../playback/playbackmanager';
import template from './recordingcreator.template.html'; import template from './recordingcreator.template.html';
import PlaceholderImage from './empty.png';
let currentDialog; let currentDialog;
let closeAction; let closeAction;
let currentRecordingFields; let currentRecordingFields;
@ -70,7 +72,7 @@ function renderRecording(context, defaultTimer, program, apiClient, refreshRecor
const imageContainer = context.querySelector('.recordingDialog-imageContainer'); const imageContainer = context.querySelector('.recordingDialog-imageContainer');
if (imgUrl) { if (imgUrl) {
imageContainer.innerHTML = '<img src="./empty.png" data-src="' + imgUrl + '" class="recordingDialog-img lazy" />'; imageContainer.innerHTML = `<img src="${PlaceholderImage}" data-src="${imgUrl}" class="recordingDialog-img lazy" />`;
imageContainer.classList.remove('hide'); imageContainer.classList.remove('hide');
imageLoader.lazyChildren(imageContainer); imageLoader.lazyChildren(imageContainer);