Cleanup deprecated metadata after migration
- delete deprecated metadata - save applied migration id per metadata holder
This commit is contained in:
@@ -2826,7 +2826,7 @@ export type DeleteCategoryMetadataMutationVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type DeleteCategoryMetadataMutation = { __typename?: 'Mutation', deleteCategoryMeta?: { __typename?: 'DeleteCategoryMetaPayload', meta?: { __typename?: 'CategoryMetaType', categoryId: number, key: string, value: string } | null, category: { __typename?: 'CategoryType', id: number, meta: Array<{ __typename?: 'CategoryMetaType', categoryId: number, key: string, value: string }> } } | null };
|
||||
export type DeleteCategoryMetadataMutation = { __typename?: 'Mutation', deleteCategoryMeta?: { __typename?: 'DeleteCategoryMetaPayload', meta?: { __typename?: 'CategoryMetaType', categoryId: number, key: string, value: string } | null } | null };
|
||||
|
||||
export type SetCategoryMetadataMutationVariables = Exact<{
|
||||
input: SetCategoryMetaInput;
|
||||
@@ -2869,7 +2869,7 @@ export type DeleteChapterMetadataMutationVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type DeleteChapterMetadataMutation = { __typename?: 'Mutation', deleteChapterMeta?: { __typename?: 'DeleteChapterMetaPayload', meta?: { __typename?: 'ChapterMetaType', chapterId: number, key: string, value: string } | null, chapter: { __typename?: 'ChapterType', id: number, meta: Array<{ __typename?: 'ChapterMetaType', chapterId: number, key: string, value: string }> } } | null };
|
||||
export type DeleteChapterMetadataMutation = { __typename?: 'Mutation', deleteChapterMeta?: { __typename?: 'DeleteChapterMetaPayload', meta?: { __typename?: 'ChapterMetaType', chapterId: number, key: string, value: string } | null } | null };
|
||||
|
||||
export type GetChapterPagesFetchMutationVariables = Exact<{
|
||||
input: FetchChapterPagesInput;
|
||||
@@ -3044,7 +3044,7 @@ export type DeleteMangaMetadataMutationVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type DeleteMangaMetadataMutation = { __typename?: 'Mutation', deleteMangaMeta?: { __typename?: 'DeleteMangaMetaPayload', meta?: { __typename?: 'MangaMetaType', mangaId: number, key: string, value: string } | null, manga: { __typename?: 'MangaType', id: number, meta: Array<{ __typename?: 'MangaMetaType', mangaId: number, key: string, value: string }> } } | null };
|
||||
export type DeleteMangaMetadataMutation = { __typename?: 'Mutation', deleteMangaMeta?: { __typename?: 'DeleteMangaMetaPayload', meta?: { __typename?: 'MangaMetaType', mangaId: number, key: string, value: string } | null } | null };
|
||||
|
||||
export type GetMangaFetchMutationVariables = Exact<{
|
||||
input: FetchMangaInput;
|
||||
@@ -3149,6 +3149,13 @@ export type SetSourceMetadataMutationVariables = Exact<{
|
||||
|
||||
export type SetSourceMetadataMutation = { __typename?: 'Mutation', setSourceMeta?: { __typename?: 'SetSourceMetaPayload', meta: { __typename?: 'SourceMetaType', sourceId: string, key: string, value: string } } | null };
|
||||
|
||||
export type DeleteSourceMetadataMutationVariables = Exact<{
|
||||
input: DeleteSourceMetaInput;
|
||||
}>;
|
||||
|
||||
|
||||
export type DeleteSourceMetadataMutation = { __typename?: 'Mutation', deleteSourceMeta?: { __typename?: 'DeleteSourceMetaPayload', meta?: { __typename?: 'SourceMetaType', sourceId: string, key: string, value: string } | null } | null };
|
||||
|
||||
export type TrackerLoginOauthMutationVariables = Exact<{
|
||||
input: LoginTrackerOAuthInput;
|
||||
}>;
|
||||
|
||||
@@ -38,12 +38,6 @@ export const DELETE_CATEGORY_METADATA = gql`
|
||||
meta {
|
||||
...CATEGORY_META_FIELDS
|
||||
}
|
||||
category {
|
||||
id
|
||||
meta {
|
||||
...CATEGORY_META_FIELDS
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -19,12 +19,6 @@ export const DELETE_CHAPTER_METADATA = gql`
|
||||
meta {
|
||||
...CHAPTER_META_FIELDS
|
||||
}
|
||||
chapter {
|
||||
id
|
||||
meta {
|
||||
...CHAPTER_META_FIELDS
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -17,12 +17,6 @@ export const DELETE_MANGA_METADATA = gql`
|
||||
meta {
|
||||
...MANGA_META_FIELDS
|
||||
}
|
||||
manga {
|
||||
id
|
||||
meta {
|
||||
...MANGA_META_FIELDS
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -46,3 +46,15 @@ export const SET_SOURCE_METADATA = gql`
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const DELETE_SOURCE_METADATA = gql`
|
||||
${SOURCE_META_FIELDS}
|
||||
|
||||
mutation DELETE_SOURCE_METADATA($input: DeleteSourceMetaInput!) {
|
||||
deleteSourceMeta(input: $input) {
|
||||
meta {
|
||||
...SOURCE_META_FIELDS
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -46,12 +46,22 @@ import {
|
||||
CreateCategoryInput,
|
||||
CreateCategoryMutation,
|
||||
CreateCategoryMutationVariables,
|
||||
DeleteCategoryMetadataMutation,
|
||||
DeleteCategoryMetadataMutationVariables,
|
||||
DeleteCategoryMutation,
|
||||
DeleteCategoryMutationVariables,
|
||||
DeleteChapterMetadataMutation,
|
||||
DeleteChapterMetadataMutationVariables,
|
||||
DeleteDownloadedChapterMutation,
|
||||
DeleteDownloadedChapterMutationVariables,
|
||||
DeleteDownloadedChaptersMutation,
|
||||
DeleteDownloadedChaptersMutationVariables,
|
||||
DeleteGlobalMetadataMutation,
|
||||
DeleteGlobalMetadataMutationVariables,
|
||||
DeleteMangaMetadataMutation,
|
||||
DeleteMangaMetadataMutationVariables,
|
||||
DeleteSourceMetadataMutation,
|
||||
DeleteSourceMetadataMutationVariables,
|
||||
DequeueChapterDownloadMutation,
|
||||
DequeueChapterDownloadMutationVariables,
|
||||
DequeueChapterDownloadsMutation,
|
||||
@@ -199,7 +209,7 @@ import {
|
||||
WebuiUpdateSubscription,
|
||||
} from '@/lib/graphql/generated/graphql.ts';
|
||||
import { GET_GLOBAL_METADATAS } from '@/lib/graphql/queries/GlobalMetadataQuery.ts';
|
||||
import { SET_GLOBAL_METADATA } from '@/lib/graphql/mutations/GlobalMetadataMutation.ts';
|
||||
import { DELETE_GLOBAL_METADATA, SET_GLOBAL_METADATA } from '@/lib/graphql/mutations/GlobalMetadataMutation.ts';
|
||||
import {
|
||||
CHECK_FOR_SERVER_UPDATES,
|
||||
CHECK_FOR_WEBUI_UPDATE,
|
||||
@@ -214,6 +224,7 @@ import {
|
||||
} from '@/lib/graphql/mutations/ExtensionMutation.ts';
|
||||
import { GET_MIGRATABLE_SOURCES, GET_SOURCES_LIST } from '@/lib/graphql/queries/SourceQuery.ts';
|
||||
import {
|
||||
DELETE_MANGA_METADATA,
|
||||
GET_MANGA_FETCH,
|
||||
GET_MANGA_TO_MIGRATE_TO_FETCH,
|
||||
SET_MANGA_METADATA,
|
||||
@@ -235,6 +246,7 @@ import {
|
||||
GET_CATEGORY_MANGAS,
|
||||
} from '@/lib/graphql/queries/CategoryQuery.ts';
|
||||
import {
|
||||
DELETE_SOURCE_METADATA,
|
||||
GET_SOURCE_MANGAS_FETCH,
|
||||
SET_SOURCE_METADATA,
|
||||
UPDATE_SOURCE_PREFERENCES,
|
||||
@@ -257,6 +269,7 @@ import {
|
||||
GET_MANGAS_CHAPTER_IDS_WITH_STATE,
|
||||
} from '@/lib/graphql/queries/ChapterQuery.ts';
|
||||
import {
|
||||
DELETE_CHAPTER_METADATA,
|
||||
GET_CHAPTER_PAGES_FETCH,
|
||||
GET_MANGA_CHAPTERS_FETCH,
|
||||
SET_CHAPTER_METADATA,
|
||||
@@ -266,6 +279,7 @@ import {
|
||||
import {
|
||||
CREATE_CATEGORY,
|
||||
DELETE_CATEGORY,
|
||||
DELETE_CATEGORY_METADATA,
|
||||
SET_CATEGORY_METADATA,
|
||||
UPDATE_CATEGORY,
|
||||
UPDATE_CATEGORY_ORDER,
|
||||
@@ -1152,6 +1166,34 @@ export class RequestManager {
|
||||
);
|
||||
}
|
||||
|
||||
public deleteGlobalMeta(
|
||||
key: string,
|
||||
options?: MutationOptions<DeleteGlobalMetadataMutation, DeleteGlobalMetadataMutationVariables>,
|
||||
): AbortableApolloMutationResponse<DeleteGlobalMetadataMutation> {
|
||||
return this.doRequest(
|
||||
GQLMethod.MUTATION,
|
||||
DELETE_GLOBAL_METADATA,
|
||||
{ input: { key } },
|
||||
{
|
||||
optimisticResponse: {
|
||||
__typename: 'Mutation',
|
||||
deleteGlobalMeta: {
|
||||
__typename: 'DeleteGlobalMetaPayload',
|
||||
meta: {
|
||||
__typename: 'GlobalMetaType',
|
||||
key,
|
||||
value: '',
|
||||
},
|
||||
},
|
||||
},
|
||||
update(cache) {
|
||||
cache.evict({ id: cache.identify({ __typename: 'GlobalMetaType', key }) });
|
||||
},
|
||||
...options,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
public useGetAbout(
|
||||
options?: QueryHookOptions<GetAboutQuery, GetAboutQueryVariables>,
|
||||
): AbortableApolloUseQueryResponse<GetAboutQuery, GetAboutQueryVariables> {
|
||||
@@ -1448,6 +1490,36 @@ export class RequestManager {
|
||||
);
|
||||
}
|
||||
|
||||
public deleteSourceMeta(
|
||||
sourceId: string,
|
||||
key: string,
|
||||
options?: MutationOptions<DeleteSourceMetadataMutation, DeleteSourceMetadataMutationVariables>,
|
||||
): AbortableApolloMutationResponse<DeleteSourceMetadataMutation> {
|
||||
return this.doRequest(
|
||||
GQLMethod.MUTATION,
|
||||
DELETE_SOURCE_METADATA,
|
||||
{ input: { sourceId, key } },
|
||||
{
|
||||
optimisticResponse: {
|
||||
__typename: 'Mutation',
|
||||
deleteSourceMeta: {
|
||||
__typename: 'DeleteSourceMetaPayload',
|
||||
meta: {
|
||||
__typename: 'SourceMetaType',
|
||||
sourceId,
|
||||
key,
|
||||
value: '',
|
||||
},
|
||||
},
|
||||
},
|
||||
update(cache) {
|
||||
cache.evict({ id: cache.identify({ __typename: 'SourceMetaType', id: sourceId, key }) });
|
||||
},
|
||||
...options,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
public useGetSourceMangas(
|
||||
input: FetchSourceMangaInput,
|
||||
initialPages: number = 1,
|
||||
@@ -1942,6 +2014,36 @@ export class RequestManager {
|
||||
);
|
||||
}
|
||||
|
||||
public deleteMangaMeta(
|
||||
mangaId: number,
|
||||
key: string,
|
||||
options?: MutationOptions<DeleteMangaMetadataMutation, DeleteMangaMetadataMutationVariables>,
|
||||
): AbortableApolloMutationResponse<DeleteMangaMetadataMutation> {
|
||||
return this.doRequest(
|
||||
GQLMethod.MUTATION,
|
||||
DELETE_MANGA_METADATA,
|
||||
{ input: { mangaId, key } },
|
||||
{
|
||||
optimisticResponse: {
|
||||
__typename: 'Mutation',
|
||||
deleteMangaMeta: {
|
||||
__typename: 'DeleteMangaMetaPayload',
|
||||
meta: {
|
||||
__typename: 'MangaMetaType',
|
||||
mangaId,
|
||||
key,
|
||||
value: '',
|
||||
},
|
||||
},
|
||||
},
|
||||
update(cache) {
|
||||
cache.evict({ id: cache.identify({ __typename: 'MangaMetaType', id: mangaId, key }) });
|
||||
},
|
||||
...options,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
public useGetChapters<Data, Variables extends OperationVariables>(
|
||||
document: DocumentNode | TypedDocumentNode<Data, Variables>,
|
||||
variables: Variables,
|
||||
@@ -2140,6 +2242,36 @@ export class RequestManager {
|
||||
);
|
||||
}
|
||||
|
||||
public deleteChapterMeta(
|
||||
chapterId: number,
|
||||
key: string,
|
||||
options?: MutationOptions<DeleteChapterMetadataMutation, DeleteChapterMetadataMutationVariables>,
|
||||
): AbortableApolloMutationResponse<DeleteChapterMetadataMutation> {
|
||||
return this.doRequest(
|
||||
GQLMethod.MUTATION,
|
||||
DELETE_CHAPTER_METADATA,
|
||||
{ input: { chapterId, key } },
|
||||
{
|
||||
optimisticResponse: {
|
||||
__typename: 'Mutation',
|
||||
deleteChapterMeta: {
|
||||
__typename: 'DeleteChapterMetaPayload',
|
||||
meta: {
|
||||
__typename: 'ChapterMetaType',
|
||||
chapterId,
|
||||
key,
|
||||
value: '',
|
||||
},
|
||||
},
|
||||
},
|
||||
update(cache) {
|
||||
cache.evict({ id: cache.identify({ __typename: 'ChapterMetaType', id: chapterId, key }) });
|
||||
},
|
||||
...options,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
public getChapterPageUrl(mangaId: number | string, chapterIndex: number | string, page: number): string {
|
||||
return this.getValidImgUrlFor(
|
||||
`manga/${mangaId}/chapter/${chapterIndex}/page/${page}`,
|
||||
@@ -2389,6 +2521,36 @@ export class RequestManager {
|
||||
);
|
||||
}
|
||||
|
||||
public deleteCategoryMeta(
|
||||
categoryId: number,
|
||||
key: string,
|
||||
options?: MutationOptions<DeleteCategoryMetadataMutation, DeleteCategoryMetadataMutationVariables>,
|
||||
): AbortableApolloMutationResponse<DeleteCategoryMetadataMutation> {
|
||||
return this.doRequest(
|
||||
GQLMethod.MUTATION,
|
||||
DELETE_CATEGORY_METADATA,
|
||||
{ input: { categoryId, key } },
|
||||
{
|
||||
optimisticResponse: {
|
||||
__typename: 'Mutation',
|
||||
deleteCategoryMeta: {
|
||||
__typename: 'DeleteCategoryMetaPayload',
|
||||
meta: {
|
||||
__typename: 'CategoryMetaType',
|
||||
categoryId,
|
||||
key,
|
||||
value: '',
|
||||
},
|
||||
},
|
||||
},
|
||||
update(cache) {
|
||||
cache.evict({ id: cache.identify({ __typename: 'CategoryMetaType', id: categoryId, key }) });
|
||||
},
|
||||
...options,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
public restoreBackupFile(
|
||||
file: File,
|
||||
options?: MutationOptions<RestoreBackupMutation, RestoreBackupMutationVariables>,
|
||||
|
||||
Reference in New Issue
Block a user