1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Add error messages for playlist editor

This commit is contained in:
Bill Thornton 2024-05-05 14:34:56 -04:00
parent e13f0ba234
commit 048d07e1a1
2 changed files with 5 additions and 0 deletions

View file

@ -4,6 +4,7 @@ import { getItemsApi } from '@jellyfin/sdk/lib/utils/api/items-api';
import { getPlaylistsApi } from '@jellyfin/sdk/lib/utils/api/playlists-api';
import escapeHtml from 'escape-html';
import toast from 'components/toast/toast';
import dom from 'scripts/dom';
import globalize from 'scripts/globalize';
import { currentSettings as userSettings } from 'scripts/settings/userSettings';
@ -52,12 +53,14 @@ function onSubmit(this: HTMLElement, e: Event) {
addToPlaylist(panel, playlistId)
.catch(err => {
console.error('[PlaylistEditor] Failed to add to playlist %s', playlistId, err);
toast(globalize.translate('PlaylistError.AddFailed'));
})
.finally(loading.hide);
} else {
createPlaylist(panel)
.catch(err => {
console.error('[PlaylistEditor] Failed to create playlist', err);
toast(globalize.translate('PlaylistError.CreateFailed'));
})
.finally(loading.hide);
}