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

apply suggestion

Co-authored-by: dmitrylyzo <56478732+dmitrylyzo@users.noreply.github.com>
This commit is contained in:
grafixeyehero 2024-09-09 02:30:21 +03:00
parent 690b1fbed5
commit 49b0ba3071
8 changed files with 17 additions and 11 deletions

View file

@ -39,6 +39,8 @@ const CancelSeriesTimerButton: FC<CancelSeriesTimerButtonProps> = ({
navigate('/livetv.html');
},
onError: (err: unknown) => {
loading.hide();
toast(globalize.translate('MessageCancelSeriesTimerError'));
console.error(
'[cancelSeriesTimer] failed to cancel series timer',
err

View file

@ -35,6 +35,8 @@ const CancelTimerButton: FC<CancelTimerButtonProps> = ({
},
onError: (err: unknown) => {
loading.hide();
toast(globalize.translate('MessageCancelTimerError'));
console.error(
'[cancelTimer] failed to cancel timer',
err

View file

@ -82,7 +82,6 @@ export interface ContextMenuOpts {
}
interface MoreCommandsButtonProps {
className?: string;
itemType: ItemKind;
selectedItemId?: string;
itemId?: string;
@ -96,7 +95,6 @@ interface MoreCommandsButtonProps {
}
const MoreCommandsButton: FC<MoreCommandsButtonProps> = ({
className,
itemType,
selectedItemId,
itemId,
@ -112,7 +110,7 @@ const MoreCommandsButton: FC<MoreCommandsButtonProps> = ({
const queryClient = useQueryClient();
const { data: item } = useGetItemByType({
itemType,
itemId: selectedItemId || itemId
itemId: selectedItemId || itemId || ''
});
const parentId = item?.SeasonId || item?.SeriesId || item?.ParentId;
@ -206,7 +204,7 @@ const MoreCommandsButton: FC<MoreCommandsButtonProps> = ({
) {
return (
<IconButton
className={className}
className='button-flat btnMoreCommands'
title={globalize.translate('ButtonMore')}
onClick={onMoreCommandsClick}
>

View file

@ -70,7 +70,7 @@ const PlayOrResumeButton: FC<PlayOrResumeButtonProps> = ({
return (
<IconButton
className='button-flat btnPlay'
className='button-flat btnPlayOrResume'
data-action={isResumable ? 'resume' : 'play'}
title={
isResumable ?

View file

@ -18,7 +18,7 @@ const ShuffleButton: FC<ShuffleButtonProps> = ({ item }) => {
return (
<IconButton
title={globalize.translate('Shuffle')}
className='paper-icon-button-light btnShuffle autoSize'
className='button-flat btnShuffle'
onClick={shuffle}
>
<ShuffleIcon />

View file

@ -6,6 +6,7 @@ import { useDeleteAlternateSources } from 'hooks/api/videosHooks';
import globalize from 'lib/globalize';
import confirm from 'components/confirm/confirm';
import loading from 'components/loading/loading';
import toast from 'components/toast/toast';
interface SplitVersionsButtonProps {
paramId: string;
@ -38,8 +39,10 @@ const SplitVersionsButton: FC<SplitVersionsButtonProps> = ({
});
},
onError: (err: unknown) => {
loading.hide();
toast(globalize.translate('MessageSplitVersionsError'));
console.error(
'[splitVersions] failed to delete Videos',
'[splitVersions] failed to split versions',
err
);
}

View file

@ -4,19 +4,17 @@ import { getLiveTvApi } from '@jellyfin/sdk/lib/utils/api/live-tv-api';
import { useQuery } from '@tanstack/react-query';
import { type JellyfinApiContext, useApi } from 'hooks/useApi';
import type { ItemDto } from 'types/base/models/item-dto';
import type{ NullableString } from 'types/base/common/shared/types';
import { ItemKind } from 'types/base/models/item-kind';
const getItemByType = async (
apiContext: JellyfinApiContext,
itemType: ItemKind,
itemId: NullableString,
itemId: string,
options?: AxiosRequestConfig
) => {
const { api, user } = apiContext;
if (!api) throw new Error('No API instance available');
if (!user?.Id) throw new Error('No User ID provided');
if (!itemId) throw new Error('No item ID provided');
let response;
switch (itemType) {
@ -46,7 +44,7 @@ const getItemByType = async (
interface UseGetItemByTypeProps {
itemType: ItemKind;
itemId: NullableString;
itemId: string;
}
export const useGetItemByType = ({

View file

@ -1045,6 +1045,9 @@
"MessageAreYouSureDeleteSubtitles": "Are you sure you wish to delete this subtitle file?",
"MessageAreYouSureYouWishToRemoveMediaFolder": "Are you sure you wish to remove this media folder?",
"MessageBrowsePluginCatalog": "Browse our plugin catalog to view available plugins.",
"MessageCancelSeriesTimerError": "An error occurred while cancel series timer",
"MessageCancelTimerError": "An error occurred while cancel timer",
"MessageSplitVersionsError": "An error occurred while split versions",
"MessageChangeRecordingPath": "Changing your recording folder will not migrate existing recordings from the old location to the new. You'll need to move them manually if desired.",
"MessageConfirmAppExit": "Do you want to exit?",
"MessageConfirmDeleteGuideProvider": "Are you sure you wish to delete this guide provider?",