refactor(i18n): adds the suffix "jellyfin" to jellyfin library sync message keys

This commit is contained in:
fallenbagel
2024-03-30 12:36:53 +05:00
parent fa3e99a931
commit 525537b4ad

View File

@@ -34,6 +34,11 @@ const messages = defineMessages({
externalUrl: 'External URL', externalUrl: 'External URL',
internalUrl: 'Internal URL', internalUrl: 'Internal URL',
jellyfinForgotPasswordUrl: 'Forgot Password URL', jellyfinForgotPasswordUrl: 'Forgot Password URL',
jellyfinSyncFailedNoLibrariesFound: 'No libraries were found',
jellyfinSyncFailedAutomaticGroupedFolders:
'Custom authentication with Automatic Library Grouping not supported',
jellyfinSyncFailedGenericError:
'Something went wrong while syncing libraries',
validationUrl: 'You must provide a valid URL', validationUrl: 'You must provide a valid URL',
syncing: 'Syncing', syncing: 'Syncing',
syncJellyfin: 'Sync Libraries', syncJellyfin: 'Sync Libraries',
@@ -45,10 +50,6 @@ const messages = defineMessages({
librariesRemaining: 'Libraries Remaining: {count}', librariesRemaining: 'Libraries Remaining: {count}',
startscan: 'Start Scan', startscan: 'Start Scan',
cancelscan: 'Cancel Scan', cancelscan: 'Cancel Scan',
syncFailedNoLibrariesFound: 'No libraries were found',
syncFailedAutomaticGroupedFolders:
'Custom authentication with Automatic Library Grouping not supported',
syncFailedGenericError: 'Something went wrong while syncing libraries',
}); });
interface Library { interface Library {
@@ -131,7 +132,9 @@ const SettingsJellyfin: React.FC<SettingsJellyfinProps> = ({
} catch (e) { } catch (e) {
if (e.response.data.message === 'SYNC_ERROR_GROUPED_FOLDERS') { if (e.response.data.message === 'SYNC_ERROR_GROUPED_FOLDERS') {
toasts.addToast( toasts.addToast(
intl.formatMessage(messages.syncFailedAutomaticGroupedFolders), intl.formatMessage(
messages.jellyfinSyncFailedAutomaticGroupedFolders
),
{ {
autoDismiss: true, autoDismiss: true,
appearance: 'warning', appearance: 'warning',
@@ -139,17 +142,20 @@ const SettingsJellyfin: React.FC<SettingsJellyfinProps> = ({
); );
} else if (e.response.data.message === 'SYNC_ERROR_NO_LIBRARIES') { } else if (e.response.data.message === 'SYNC_ERROR_NO_LIBRARIES') {
toasts.addToast( toasts.addToast(
intl.formatMessage(messages.syncFailedNoLibrariesFound), intl.formatMessage(messages.jellyfinSyncFailedNoLibrariesFound),
{ {
autoDismiss: true, autoDismiss: true,
appearance: 'error', appearance: 'error',
} }
); );
} else { } else {
toasts.addToast(intl.formatMessage(messages.syncFailedGenericError), { toasts.addToast(
autoDismiss: true, intl.formatMessage(messages.jellyfinSyncFailedGenericError),
appearance: 'error', {
}); autoDismiss: true,
appearance: 'error',
}
);
} }
setIsSyncing(false); setIsSyncing(false);
revalidate(); revalidate();