Fix refreshing manga during migration search
This commit is contained in:
@@ -3933,6 +3933,13 @@ export type GetMangaFetchMutationVariables = Exact<{
|
||||
|
||||
export type GetMangaFetchMutation = { __typename?: 'Mutation', fetchManga?: { __typename?: 'FetchMangaPayload', manga: { __typename?: 'MangaType', artist?: string | null, author?: string | null, description?: string | null, status: MangaStatus, realUrl?: string | null, sourceId: string, genre: Array<string>, lastFetchedAt?: string | null, inLibraryAt: string, id: number, title: string, thumbnailUrl?: string | null, thumbnailUrlLastFetched?: string | null, inLibrary: boolean, initialized: boolean, unreadCount: number, downloadCount: number, bookmarkCount: number, hasDuplicateChapters: boolean, meta: Array<{ __typename?: 'MangaMetaType', mangaId: number, key: string, value: string }>, source?: { __typename?: 'SourceType', id: string, name: string, displayName: string, lang: string, iconUrl: string } | null, trackRecords: { __typename?: 'TrackRecordNodeList', totalCount: number, nodes: Array<{ __typename?: 'TrackRecordType', id: number, trackerId: number }> }, firstUnreadChapter?: { __typename?: 'ChapterType', id: number, sourceOrder: number, isRead: boolean, mangaId: number, chapterNumber: number, name: string, scanlator?: string | null } | null, lastReadChapter?: { __typename?: 'ChapterType', id: number, sourceOrder: number, lastReadAt: string } | null, latestReadChapter?: { __typename?: 'ChapterType', id: number, sourceOrder: number, lastReadAt: string } | null, latestFetchedChapter?: { __typename?: 'ChapterType', id: number, fetchedAt: string } | null, latestUploadedChapter?: { __typename?: 'ChapterType', id: number, uploadDate: string } | null, highestNumberedChapter?: { __typename?: 'ChapterType', id: number, chapterNumber: number } | null, chapters: { __typename?: 'ChapterNodeList', totalCount: number } } } | null };
|
||||
|
||||
export type RefreshMangaMutationVariables = Exact<{
|
||||
id: Scalars['Int']['input'];
|
||||
}>;
|
||||
|
||||
|
||||
export type RefreshMangaMutation = { __typename?: 'Mutation', fetchChapters?: { __typename?: 'FetchChaptersPayload', chapters: Array<{ __typename?: 'ChapterType', fetchedAt: string, uploadDate: string, lastReadAt: string, id: number, name: string, mangaId: number, scanlator?: string | null, realUrl?: string | null, sourceOrder: number, chapterNumber: number, isRead: boolean, isDownloaded: boolean, isBookmarked: boolean }> } | null, fetchManga?: { __typename?: 'FetchMangaPayload', manga: { __typename?: 'MangaType', artist?: string | null, author?: string | null, description?: string | null, status: MangaStatus, realUrl?: string | null, sourceId: string, genre: Array<string>, lastFetchedAt?: string | null, inLibraryAt: string, id: number, title: string, thumbnailUrl?: string | null, thumbnailUrlLastFetched?: string | null, inLibrary: boolean, initialized: boolean, unreadCount: number, downloadCount: number, bookmarkCount: number, hasDuplicateChapters: boolean, meta: Array<{ __typename?: 'MangaMetaType', mangaId: number, key: string, value: string }>, source?: { __typename?: 'SourceType', id: string, name: string, displayName: string, lang: string, iconUrl: string } | null, trackRecords: { __typename?: 'TrackRecordNodeList', totalCount: number, nodes: Array<{ __typename?: 'TrackRecordType', id: number, trackerId: number }> }, firstUnreadChapter?: { __typename?: 'ChapterType', id: number, sourceOrder: number, isRead: boolean, mangaId: number, chapterNumber: number, name: string, scanlator?: string | null } | null, lastReadChapter?: { __typename?: 'ChapterType', id: number, sourceOrder: number, lastReadAt: string } | null, latestReadChapter?: { __typename?: 'ChapterType', id: number, sourceOrder: number, lastReadAt: string } | null, latestFetchedChapter?: { __typename?: 'ChapterType', id: number, fetchedAt: string } | null, latestUploadedChapter?: { __typename?: 'ChapterType', id: number, uploadDate: string } | null, highestNumberedChapter?: { __typename?: 'ChapterType', id: number, chapterNumber: number } | null, chapters: { __typename?: 'ChapterNodeList', totalCount: number } } } | null };
|
||||
|
||||
export type GetMangaToMigrateToFetchMutationVariables = Exact<{
|
||||
id: Scalars['Int']['input'];
|
||||
migrateChapters: Scalars['Boolean']['input'];
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
import gql from 'graphql-tag';
|
||||
import { MANGA_META_FIELDS, MANGA_SCREEN_FIELDS } from '@/lib/graphql/manga/MangaFragments.ts';
|
||||
import { CHAPTER_LIST_FIELDS } from '@/lib/graphql/chapter/ChapterFragments.ts';
|
||||
|
||||
// makes the server fetch and return the manga
|
||||
export const GET_MANGA_FETCH = gql`
|
||||
@@ -22,6 +23,25 @@ export const GET_MANGA_FETCH = gql`
|
||||
}
|
||||
`;
|
||||
|
||||
// makes the server fetch and return the manga
|
||||
export const REFRESH_MANGA = gql`
|
||||
${MANGA_SCREEN_FIELDS}
|
||||
${CHAPTER_LIST_FIELDS}
|
||||
|
||||
mutation REFRESH_MANGA($id: Int!) {
|
||||
fetchChapters(input: { mangaId: $id }) {
|
||||
chapters {
|
||||
...CHAPTER_LIST_FIELDS
|
||||
}
|
||||
}
|
||||
fetchManga(input: { id: $id }) {
|
||||
manga {
|
||||
...MANGA_SCREEN_FIELDS
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
// makes the server fetch and return the manga
|
||||
export const GET_MANGA_TO_MIGRATE_TO_FETCH = gql`
|
||||
mutation GET_MANGA_TO_MIGRATE_TO_FETCH(
|
||||
|
||||
@@ -212,6 +212,8 @@ import type {
|
||||
DeleteChapterMetasInput,
|
||||
SetCategoryMetasInput,
|
||||
DeleteCategoryMetasInput,
|
||||
RefreshMangaMutation,
|
||||
RefreshMangaMutationVariables,
|
||||
} from '@/lib/graphql/generated/graphql.ts';
|
||||
import {
|
||||
CategoryOrderBy,
|
||||
@@ -240,6 +242,7 @@ import { GET_MIGRATABLE_SOURCES, GET_SOURCES_LIST } from '@/lib/graphql/source/S
|
||||
import {
|
||||
GET_MANGA_FETCH,
|
||||
GET_MANGA_TO_MIGRATE_TO_FETCH,
|
||||
REFRESH_MANGA,
|
||||
UPDATE_MANGA,
|
||||
UPDATE_MANGA_CATEGORIES,
|
||||
UPDATE_MANGA_METADATA,
|
||||
@@ -2218,6 +2221,20 @@ export class RequestManager {
|
||||
);
|
||||
}
|
||||
|
||||
public refreshManga(
|
||||
mangaId: number | string,
|
||||
options?: MutationOptions<RefreshMangaMutation, RefreshMangaMutationVariables>,
|
||||
): AbortableApolloMutationResponse<RefreshMangaMutation> {
|
||||
return this.doRequest<RefreshMangaMutation, RefreshMangaMutationVariables>(
|
||||
GQLMethod.MUTATION,
|
||||
REFRESH_MANGA,
|
||||
{
|
||||
id: Number(mangaId),
|
||||
},
|
||||
{ refetchQueries: [GET_CHAPTERS_MANGA], ...options },
|
||||
);
|
||||
}
|
||||
|
||||
public getMangaToMigrateToFetch(
|
||||
mangaId: number | string,
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user