mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Replace hardcoded string for BaseItemKind values
This commit is contained in:
parent
d0e3837736
commit
58e12db814
2 changed files with 7 additions and 5 deletions
|
@ -10,17 +10,18 @@ import { playbackManager } from './playback/playbackmanager';
|
|||
import ServerConnections from './ServerConnections';
|
||||
import toast from './toast/toast';
|
||||
import * as userSettings from '../scripts/settings/userSettings';
|
||||
import { BaseItemKind } from '@jellyfin/sdk/lib/generated-client/models/base-item-kind';
|
||||
|
||||
function getDeleteLabel(type) {
|
||||
switch (type) {
|
||||
case 'Series':
|
||||
case BaseItemKind.Series:
|
||||
return globalize.translate('DeleteSeries');
|
||||
|
||||
case 'Episode':
|
||||
case BaseItemKind.Episode:
|
||||
return globalize.translate('DeleteEpisode');
|
||||
|
||||
case 'Playlist':
|
||||
case 'BoxSet':
|
||||
case BaseItemKind.Playlist:
|
||||
case BaseItemKind.BoxSet:
|
||||
return globalize.translate('Delete');
|
||||
|
||||
default:
|
||||
|
|
|
@ -4,13 +4,14 @@ import { appRouter } from '../components/router/appRouter';
|
|||
import globalize from './globalize';
|
||||
import ServerConnections from '../components/ServerConnections';
|
||||
import alert from '../components/alert';
|
||||
import { BaseItemKind } from '@jellyfin/sdk/lib/generated-client/models/base-item-kind';
|
||||
|
||||
function alertText(options) {
|
||||
return alert(options);
|
||||
}
|
||||
|
||||
function getDeletionConfirmContent(item) {
|
||||
if (item.Type === 'Series') {
|
||||
if (item.Type === BaseItemKind.Series) {
|
||||
const totalEpisodes = item.RecursiveItemCount;
|
||||
return {
|
||||
title: globalize.translate('HeaderDeleteSeries'),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue