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

View file

@ -1257,6 +1257,8 @@
"PlayCount": "Play count", "PlayCount": "Play count",
"Played": "Played", "Played": "Played",
"PlayFromBeginning": "Play from beginning", "PlayFromBeginning": "Play from beginning",
"PlaylistError.AddFailed": "Error adding to playlist",
"PlaylistError.CreateFailed": "Error creating playlist",
"Playlists": "Playlists", "Playlists": "Playlists",
"PlayNext": "Play next", "PlayNext": "Play next",
"PlayNextEpisodeAutomatically": "Play next episode automatically", "PlayNextEpisodeAutomatically": "Play next episode automatically",