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