Rename metadata migration setting flags
This commit is contained in:
@@ -35,7 +35,7 @@ export const MigrateDialog = ({ mangaIdToMigrateTo, onClose }: { mangaIdToMigrat
|
||||
const mangaId = Number(mangaIdAsString);
|
||||
|
||||
const {
|
||||
settings: { includeChapters, includeCategories, deleteChapters },
|
||||
settings: { migrateChapters, migrateCategories, deleteChapters },
|
||||
} = useMetadataServerSettings();
|
||||
|
||||
const [isMigrationInProcess, setIsMigrationInProcess] = useState(false);
|
||||
@@ -56,8 +56,8 @@ export const MigrateDialog = ({ mangaIdToMigrateTo, onClose }: { mangaIdToMigrat
|
||||
try {
|
||||
await Mangas.migrate(mangaId, mangaIdToMigrateTo, {
|
||||
mode,
|
||||
migrateChapters: includeChapters,
|
||||
migrateCategories: includeCategories,
|
||||
migrateChapters,
|
||||
migrateCategories,
|
||||
deleteChapters,
|
||||
});
|
||||
|
||||
@@ -75,14 +75,14 @@ export const MigrateDialog = ({ mangaIdToMigrateTo, onClose }: { mangaIdToMigrat
|
||||
<CheckboxInput
|
||||
disabled={isMigrationInProcess}
|
||||
label={t('chapter.title')}
|
||||
checked={includeChapters}
|
||||
onChange={(_, checked) => setMigrationFlag('includeChapters', checked)}
|
||||
checked={migrateChapters}
|
||||
onChange={(_, checked) => setMigrationFlag('migrateChapters', checked)}
|
||||
/>
|
||||
<CheckboxInput
|
||||
disabled={isMigrationInProcess}
|
||||
label={t('category.title.category_one')}
|
||||
checked={includeCategories}
|
||||
onChange={(_, checked) => setMigrationFlag('includeCategories', checked)}
|
||||
checked={migrateCategories}
|
||||
onChange={(_, checked) => setMigrationFlag('migrateCategories', checked)}
|
||||
/>
|
||||
<CheckboxInput
|
||||
disabled={isMigrationInProcess}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
import { t as translate } from 'i18next';
|
||||
import { DocumentNode } from '@apollo/client/core';
|
||||
import { TManga, TranslationKey } from '@/typings.ts';
|
||||
import { MetadataMigrationSettings, TManga, TranslationKey } from '@/typings.ts';
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
import {
|
||||
ChapterConditionInput,
|
||||
@@ -125,10 +125,7 @@ type ChangeCategoriesOptions = { changeCategoriesPatch: UpdateMangaCategoriesPat
|
||||
type MigrateOptions = {
|
||||
mangaIdToMigrateTo: number;
|
||||
mode: MigrateMode;
|
||||
migrateChapters?: boolean;
|
||||
migrateCategories?: boolean;
|
||||
deleteChapters?: boolean;
|
||||
};
|
||||
} & Partial<MetadataMigrationSettings>;
|
||||
|
||||
type MarkAsReadActionOption = MarkAsReadOptions &
|
||||
PropertiesNever<ChangeCategoriesOptions> &
|
||||
|
||||
@@ -39,8 +39,8 @@ const GLOBAL_METADATA_KEYS: AppMetadataKeys[] = [
|
||||
'devices',
|
||||
|
||||
// migration
|
||||
'includeChapters',
|
||||
'includeCategories',
|
||||
'migrateChapters',
|
||||
'migrateCategories',
|
||||
'deleteChapters',
|
||||
|
||||
// browse
|
||||
|
||||
@@ -35,8 +35,8 @@ export const getDefaultSettings = (): MetadataServerSettings => ({
|
||||
devices: [DEFAULT_DEVICE],
|
||||
|
||||
// migration
|
||||
includeChapters: true,
|
||||
includeCategories: true,
|
||||
migrateChapters: true,
|
||||
migrateCategories: true,
|
||||
deleteChapters: true,
|
||||
|
||||
// browse
|
||||
|
||||
@@ -240,8 +240,8 @@ export type MetadataClientSettings = {
|
||||
};
|
||||
|
||||
export type MetadataMigrationSettings = {
|
||||
includeChapters: boolean;
|
||||
includeCategories: boolean;
|
||||
migrateChapters: boolean;
|
||||
migrateCategories: boolean;
|
||||
deleteChapters: boolean;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user