Add sync settings
This commit is contained in:
@@ -30,6 +30,7 @@ import {
|
||||
} from '@/lib/graphql/generated/graphql-base.types.ts';
|
||||
import { ThemeMode } from '@/features/theme/AppTheme.types.ts';
|
||||
import { getPreferredISOLanguageCodes } from '@/lib/ISOLanguageUtil.ts';
|
||||
import type { BackupFlag } from '@/features/backup/Backup.types.ts';
|
||||
|
||||
export const MANGA_GRID_WIDTH = {
|
||||
min: 100,
|
||||
@@ -317,3 +318,45 @@ export const IMAGE_PROCESSING_TYPE_TO_SETTING: Record<
|
||||
[ImageProcessingType.DOWNLOAD]: 'downloadConversions',
|
||||
[ImageProcessingType.SERVE]: 'serveConversions',
|
||||
};
|
||||
|
||||
const SYNC_INTERVAL_TO_TRANSLATION: Record<string, SelectSettingValueDisplayInfo> = {
|
||||
[d(0).seconds.asWholeMinutes.toISOString()]: {
|
||||
text: msg`Disabled`,
|
||||
},
|
||||
[d(30).minutes.asWholeMinutes.toISOString()]: {
|
||||
text: msg`Every 30 minutes`,
|
||||
},
|
||||
[d(1).hours.asWholeMinutes.toISOString()]: {
|
||||
text: msg`Every hour`,
|
||||
},
|
||||
[d(3).hours.asWholeMinutes.toISOString()]: {
|
||||
text: msg`Every 3 hours`,
|
||||
},
|
||||
[d(6).hours.asWholeMinutes.toISOString()]: {
|
||||
text: msg`Every 6 hours`,
|
||||
},
|
||||
[d(12).hours.asWholeMinutes.toISOString()]: {
|
||||
text: msg`Every 12 hours`,
|
||||
},
|
||||
[d(1).days.asWholeMinutes.toISOString()]: {
|
||||
text: msg`Daily`,
|
||||
},
|
||||
[d(7).days.asWholeMinutes.toISOString()]: {
|
||||
text: msg`Weekly`,
|
||||
},
|
||||
};
|
||||
export const SYNC_INTERVAL_CUSTOM_VALUE = d(10).days.asWholeMinutes.toISOString();
|
||||
export const SYNC_INTERVAL_VALUES = Object.keys(SYNC_INTERVAL_TO_TRANSLATION);
|
||||
export const SYNC_INTERVAL_SELECT_VALUES: SelectSettingValue<string>[] = SYNC_INTERVAL_VALUES.map((value) => [
|
||||
value,
|
||||
SYNC_INTERVAL_TO_TRANSLATION[value],
|
||||
]);
|
||||
export const SYNC_INTERVAL_SELECT_VALUES_WITH_CUSTOM: SelectSettingValue<string>[] = [
|
||||
...SYNC_INTERVAL_SELECT_VALUES,
|
||||
[SYNC_INTERVAL_CUSTOM_VALUE, { text: msg`Custom` }],
|
||||
];
|
||||
|
||||
export const SYNC_SETTINGS_HIDDEN_BACKUP_FLAGS = [
|
||||
'includeServerSettings',
|
||||
'includeClientData',
|
||||
] as const satisfies BackupFlag[];
|
||||
|
||||
Reference in New Issue
Block a user